deftype and defmethod syntax major changes (#3094)

Major change to how `deftype` shows up in our code:
- the decompiler will no longer emit the `offset-assert`,
`method-count-assert`, `size-assert` and `flag-assert` parameters. There
are extremely few cases where having this in the decompiled code is
helpful, as the types there come from `all-types` which already has
those parameters. This also doesn't break type consistency because:
  - the asserts aren't compared.
- the first step of the test uses `all-types`, which has the asserts,
which will throw an error if they're bad.
- the decompiler won't emit the `heap-base` parameter unless necessary
now.
- the decompiler will try its hardest to turn a fixed-offset field into
an `overlay-at` field. It falls back to the old offset if all else
fails.
- `overlay-at` now supports field "dereferencing" to specify the offset
that's within a field that's a structure, e.g.:
```lisp
(deftype foobar (structure)
  ((vec    vector  :inline)
   (flags  int32   :overlay-at (-> vec w))
   )
  )
```
in this structure, the offset of `flags` will be 12 because that is the
final offset of `vec`'s `w` field within this structure.
- **removed ID from all method declarations.** IDs are only ever
automatically assigned now. Fixes #3068.
- added an `:overlay` parameter to method declarations, in order to
declare a new method that goes on top of a previously-defined method.
Syntax is `:overlay <method-name>`. Please do not ever use this.
- added `state-methods` list parameter. This lets you quickly specify a
list of states to be put in the method table. Same syntax as the
`states` list parameter. The decompiler will try to put as many states
in this as it can without messing with the method ID order.

Also changes `defmethod` to make the first type definition (before the
arguments) optional. The type can now be inferred from the first
argument. Fixes #3093.

---------

Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
This commit is contained in:
ManDude
2023-10-30 03:20:02 +00:00
committed by GitHub
parent 09536c68ac
commit cd68cb671e
2079 changed files with 94384 additions and 117066 deletions
+94 -1
View File
@@ -8,5 +8,98 @@
"editor.wordBasedSuggestions": true,
"editor.snippetSuggestions": "top"
},
"python.formatting.provider": "black"
"python.formatting.provider": "black",
"files.associations": {
"optional": "cpp",
"algorithm": "cpp",
"any": "cpp",
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"bitset": "cpp",
"cctype": "cpp",
"charconv": "cpp",
"chrono": "cpp",
"cinttypes": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"codecvt": "cpp",
"compare": "cpp",
"concepts": "cpp",
"condition_variable": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"exception": "cpp",
"filesystem": "cpp",
"format": "cpp",
"forward_list": "cpp",
"fstream": "cpp",
"functional": "cpp",
"future": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"ios": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"iterator": "cpp",
"limits": "cpp",
"list": "cpp",
"locale": "cpp",
"map": "cpp",
"memory": "cpp",
"mutex": "cpp",
"new": "cpp",
"numeric": "cpp",
"ostream": "cpp",
"queue": "cpp",
"random": "cpp",
"ranges": "cpp",
"ratio": "cpp",
"regex": "cpp",
"set": "cpp",
"shared_mutex": "cpp",
"span": "cpp",
"sstream": "cpp",
"stack": "cpp",
"stdexcept": "cpp",
"stop_token": "cpp",
"streambuf": "cpp",
"string": "cpp",
"system_error": "cpp",
"thread": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"typeinfo": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"utility": "cpp",
"valarray": "cpp",
"variant": "cpp",
"vector": "cpp",
"xfacet": "cpp",
"xhash": "cpp",
"xiosbase": "cpp",
"xlocale": "cpp",
"xlocbuf": "cpp",
"xlocinfo": "cpp",
"xlocmes": "cpp",
"xlocmon": "cpp",
"xlocnum": "cpp",
"xloctime": "cpp",
"xmemory": "cpp",
"xstddef": "cpp",
"xstring": "cpp",
"xtr1common": "cpp",
"xtree": "cpp",
"xutility": "cpp"
}
}
+5 -1
View File
@@ -288,7 +288,11 @@ void break_list(Node* node) {
node->sub_elt_indent += name.size();
} else if (name == "defmethod") {
// things with 4 things in the top line: (defmethod <method> <type> <args>
node->top_line_count = 4;
// or just 3 things in the top line: (defmethod <method> <args>
node->top_line_count = 3;
if (node->child_nodes.size() >= 4 && node->child_nodes[2].kind == Node::Kind::ATOM) {
node->top_line_count = 4;
}
} else if (name == "until" || name == "while" || name == "dotimes" || name == "countdown" ||
name == "when" || name == "behavior" || name == "lambda" || name == "defpart" ||
name == "define") {
+6 -4
View File
@@ -421,10 +421,12 @@ int Type::get_num_methods() const {
* Add a method defined specifically for this type.
*/
const MethodInfo& Type::add_method(const MethodInfo& info) {
for (auto it = m_methods.rbegin(); it != m_methods.rend(); it++) {
if (!it->overrides_parent && !it->only_overrides_docstring) {
ASSERT(it->id + 1 == info.id);
break;
if (!info.overrides_parent) {
for (auto it = m_methods.rbegin(); it != m_methods.rend(); it++) {
if (!it->overrides_parent && !it->only_overrides_docstring) {
ASSERT(it->id + 1 == info.id);
break;
}
}
}
+1
View File
@@ -32,6 +32,7 @@ struct MethodInfo {
bool overrides_parent = false;
bool only_overrides_docstring = false;
std::optional<std::string> docstring;
std::optional<std::string> overlay_name;
bool operator==(const MethodInfo& other) const;
bool operator!=(const MethodInfo& other) const { return !((*this) == other); }
+264 -67
View File
@@ -516,14 +516,13 @@ int TypeSystem::get_load_size_allow_partial_def(const TypeSpec& ts) const {
}
MethodInfo TypeSystem::override_method(Type* type,
const std::string& /*type_name*/,
const int method_id,
const std::string& method_name,
const std::optional<std::string>& docstring) {
// Lookup the method from the parent type
MethodInfo existing_info;
bool exists = try_lookup_method(type->get_parent(), method_id, &existing_info);
bool exists = try_lookup_method(type->get_parent(), method_name, &existing_info);
if (!exists) {
throw_typesystem_error("Trying to use override a method that has no parent declaration");
throw_typesystem_error("Trying to override a method that has no parent declaration");
}
// use the existing ID.
return type->add_method({existing_info.id, existing_info.name, existing_info.type,
@@ -554,8 +553,7 @@ MethodInfo TypeSystem::declare_method(Type* type,
const std::optional<std::string>& docstring,
bool no_virtual,
const TypeSpec& ts,
bool override_type,
int id) {
bool override_type) {
if (method_name == "new") {
if (override_type) {
throw_typesystem_error("Cannot use :replace option with a new method.");
@@ -569,7 +567,7 @@ MethodInfo TypeSystem::declare_method(Type* type,
if (override_type) {
if (!got_existing) {
if (id != -1 && try_lookup_method(type->get_parent(), id, &existing_info)) {
if (try_lookup_method(type->get_parent(), method_name, &existing_info)) {
} else {
throw_typesystem_error(
"Cannot use :replace on method {} of {} because this method was not previously "
@@ -616,6 +614,34 @@ MethodInfo TypeSystem::declare_method(Type* type,
}
}
/*!
* Adds a new method that is overlayed on top of a different, existing method.
* This should be used basically never (happens once in Jak 1).
*/
MethodInfo TypeSystem::overlay_method(Type* type,
const std::string& method_name,
const std::string& method_overlay_name,
const std::optional<std::string>& docstring,
const TypeSpec& ts) {
// look up the method
MethodInfo existing_info;
bool got_existing = try_lookup_method(type, method_overlay_name, &existing_info);
if (!got_existing) {
if (try_lookup_method(type->get_parent(), method_overlay_name, &existing_info)) {
} else {
throw_typesystem_error(
"Cannot use :overlay-at on method {} of {} because this method was not previously "
"declared in a parent.",
method_overlay_name, type->get_name());
}
}
// use the existing ID.
return type->add_method({existing_info.id, method_name, ts, type->get_name(), false, true, false,
docstring, std::make_optional(method_overlay_name)});
}
MethodInfo TypeSystem::define_method(const std::string& type_name,
const std::string& method_name,
const TypeSpec& ts,
@@ -1885,30 +1911,36 @@ std::string TypeSystem::generate_deftype_footer(const Type* type) const {
}
}
if (type->heap_base()) {
if (type->heap_base() &&
type->heap_base() !=
((type->get_size_in_memory() - get_type_of_type<BasicType>("process")->size() + 0xf) &
~0xf)) {
// don't print if auto heap-base does the job
result.append(fmt::format(" :heap-base #x{:x}\n", type->heap_base()));
}
auto method_count = get_next_method_id(type);
result.append(fmt::format(" :method-count-assert {}\n", get_next_method_id(type)));
result.append(fmt::format(" :size-assert #x{:x}\n", type->get_size_in_memory()));
// result.append(fmt::format(" :method-count-assert {}\n", get_next_method_id(type)));
// result.append(fmt::format(" :size-assert #x{:x}\n", type->get_size_in_memory()));
TypeFlags flags;
flags.heap_base = type->heap_base();
flags.size = type->get_size_in_memory();
flags.pad = 0;
flags.methods = method_count;
result.append(fmt::format(" :flag-assert #x{:x}\n ", flags.flag));
// result.append(fmt::format(" :flag-assert #x{:x}\n", flags.flag));
if (!type->gen_inspect()) {
result.append(":no-inspect\n ");
result.append(" :no-inspect\n ");
}
std::string methods_string;
std::string state_methods_string;
std::string states_string;
// New Method
auto new_info = type->get_new_method_defined_for_type();
if (new_info) {
methods_string.append("(new (");
methods_string.append(" (new (");
for (size_t i = 0; i < new_info->type.arg_count() - 1; i++) {
methods_string.append(new_info->type.get_arg(i).print());
if (i != new_info->type.arg_count() - 2) {
@@ -1916,24 +1948,41 @@ std::string TypeSystem::generate_deftype_footer(const Type* type) const {
}
}
methods_string.append(
fmt::format(") {} ", new_info->type.get_arg(new_info->type.arg_count() - 1).print(), 0));
fmt::format(") {}", new_info->type.get_arg(new_info->type.arg_count() - 1).print(), 0));
auto behavior = new_info->type.try_get_tag("behavior");
if (behavior) {
methods_string.append(fmt::format(":behavior {} ", *behavior));
methods_string.append(fmt::format(" :behavior {}", *behavior));
}
methods_string.append("0)\n ");
methods_string.append(")\n");
}
// Rest of methods
bool done_with_state_methods = false; // TODO fix this... this depends on the order of m_methods
for (auto& info : type->get_methods_defined_for_type()) {
if (!done_with_state_methods && info.type.base_type() == "state" && !info.overrides_parent) {
if (info.type.arg_count() > 1) {
state_methods_string.append(fmt::format(" ({}", info.name));
for (size_t i = 0; i < info.type.arg_count() - 1; ++i) {
state_methods_string.push_back(' ');
state_methods_string.append(info.type.get_arg(i).print());
}
state_methods_string.append(")\n");
} else {
state_methods_string.append(fmt::format(" {}\n", info.name));
}
continue;
} else {
done_with_state_methods = true;
}
// check if we only override the docstring
if (info.only_overrides_docstring) {
continue;
}
methods_string.append(fmt::format("({} (", info.name));
methods_string.append(fmt::format(" ({} (", info.name));
for (size_t i = 0; i < info.type.arg_count() - 1; i++) {
methods_string.append(info.type.get_arg(i).print());
if (i != info.type.arg_count() - 2) {
@@ -1941,35 +1990,32 @@ std::string TypeSystem::generate_deftype_footer(const Type* type) const {
}
}
methods_string.append(
fmt::format(") {} ", info.type.get_arg(info.type.arg_count() - 1).print()));
if (info.no_virtual) {
methods_string.append(":no-virtual ");
}
if (info.overrides_parent) {
methods_string.append(":replace ");
}
fmt::format(") {}", info.type.get_arg(info.type.arg_count() - 1).print()));
auto behavior = info.type.try_get_tag("behavior");
if (behavior) {
methods_string.append(fmt::format(":behavior {} ", *behavior));
methods_string.append(fmt::format(" :behavior {}", *behavior));
}
if (info.type.base_type() == "state") {
methods_string.append(":state ");
methods_string.append(" :state");
}
methods_string.append(fmt::format("{})\n ", info.id));
if (info.no_virtual) {
methods_string.append(" :no-virtual");
}
if (info.overrides_parent) {
if (info.overlay_name.has_value()) {
methods_string.append(fmt::format(" :overlay-at {}", *info.overlay_name));
} else {
methods_string.append(" :replace");
}
}
methods_string.append(fmt::format(")\n", info.id));
}
if (!methods_string.empty()) {
result.append("(:methods\n ");
result.append(methods_string);
result.append(")\n ");
}
std::string states_string;
for (auto& info : type->get_states_declared_for_type()) {
if (info.second.arg_count() > 1) {
states_string.append(fmt::format(" ({}", info.first));
@@ -1983,16 +2029,157 @@ std::string TypeSystem::generate_deftype_footer(const Type* type) const {
}
}
if (!states_string.empty()) {
result.append("(:states\n");
result.append(states_string);
result.append(" )\n ");
if (!state_methods_string.empty()) {
result.append(" (:state-methods\n");
result.append(state_methods_string);
result.append(" )\n");
}
result.append(")\n");
if (!methods_string.empty()) {
result.append(" (:methods\n");
result.append(methods_string);
result.append(" )\n");
}
if (!states_string.empty()) {
result.append(" (:states\n");
result.append(states_string);
result.append(" )\n");
}
result.append(" )\n");
return result;
}
std::optional<std::string> find_best_field_in_structure(const TypeSystem& ts,
const StructureType* st,
int offset,
const Field& requesting_field,
bool want_fixed,
int start_field,
int end_field = -1) {
// performs best field lookup within a structure, at an offset.
const Field* best_val = nullptr;
const Field* best_exact = nullptr;
const Field* best_struct = nullptr;
std::pair<const Field*, int> best_val_arr = {nullptr, -1};
std::pair<const Field*, int> best_exact_arr = {nullptr, -1};
std::pair<const Field*, int> best_struct_arr = {nullptr, -1};
std::optional<std::string> best_struct_field_deref;
const Field* best = nullptr;
if (end_field == -1) {
end_field = st->fields().size();
}
for (size_t i = start_field; i < end_field; ++i) {
const auto& field = st->fields().at(i);
auto type = ts.lookup_type(field.type());
if (field.is_dynamic() || field.offset() > offset || field.user_placed() != want_fixed) {
continue;
}
if (!field.is_array()) {
if (!field.is_inline() && field.offset() + type->get_load_size() > offset) {
if (field.offset() == offset) {
// not array, not inline - can fit in register, only check exact offset.
if (!best_val ||
type->get_load_size() == ts.lookup_type(requesting_field.type())->get_load_size()) {
best_val = &field;
}
}
} else if (field.is_inline() && field.offset() + type->get_size_in_memory() > offset) {
if (field.type() == requesting_field.type() && field.offset() == offset) {
// not array, inlined and exact same as this field, just overlay directly on top
best_exact = &field;
} else {
auto f_type = dynamic_cast<StructureType*>(type);
if (f_type) {
// struct that encompasses this field
// simply search that structure for the field we want, offset by the field's offset
auto best_field_in_struct = find_best_field_in_structure(
ts, f_type, offset - field.offset(), requesting_field, want_fixed, 0);
if (best_field_in_struct) {
best_struct_field_deref = best_field_in_struct;
best_struct = &field;
}
}
}
}
} else {
int rel_offset = offset - field.offset();
// array case (and array encompasses what we want)
int array_idx = rel_offset / type->get_size_in_memory();
if (!field.is_inline() &&
field.offset() + field.array_size() * type->get_load_size() > offset) {
if (rel_offset % type->get_load_size() == 0) {
// found exact match for array index
if (!best_val_arr.first ||
type->get_load_size() == ts.lookup_type(requesting_field.type())->get_load_size()) {
best_val_arr.first = &field;
best_val_arr.second = rel_offset / type->get_load_size();
}
}
} else if (field.is_inline() &&
field.offset() + field.array_size() * type->get_size_in_memory() > offset) {
if (field.type() == requesting_field.type() &&
rel_offset % type->get_size_in_memory() == 0) {
// same type
best_exact_arr.first = &field;
best_exact_arr.second = array_idx;
} else if (requesting_field.is_array() && rel_offset % type->get_size_in_memory() == 0 &&
array_idx == 0) {
// starts at the same offset as another array. just use the field with nothing extra
best_exact = &field;
} else {
auto f_type = dynamic_cast<StructureType*>(type);
if (f_type && field.offset() + f_type->get_size_in_memory() > offset) {
// struct that encompasses this field
// simply search that structure for the field we want, offset by the field's offset
auto best_field_in_struct =
find_best_field_in_structure(ts, f_type, rel_offset % type->get_size_in_memory(),
requesting_field, want_fixed, 0);
if (best_field_in_struct) {
best_struct_field_deref = best_field_in_struct;
best_struct_arr.first = &field;
best_struct_arr.second = array_idx;
}
}
}
}
}
}
int best_array_idx = -1;
if (best_exact) {
best = best_exact;
} else if (best_exact_arr.first) {
best = best_exact_arr.first;
best_array_idx = best_exact_arr.second;
} else if (best_val) {
best = best_val;
} else if (best_val_arr.first) {
best = best_val_arr.first;
best_array_idx = best_val_arr.second;
} else if (best_struct) {
best = best_struct;
} else if (best_struct_arr.first) {
best = best_struct_arr.first;
best_array_idx = best_struct_arr.second;
}
if (best) {
auto ret =
best_array_idx == -1 ? best->name() : fmt::format("{} {}", best->name(), best_array_idx);
if (best == best_struct || best == best_struct_arr.first) {
return ret + " " + *best_struct_field_deref;
} else {
return ret;
}
} else if (!want_fixed) {
// try again but with a user-placed offset
return find_best_field_in_structure(ts, st, offset, requesting_field, true, start_field,
end_field);
}
return {};
}
std::string TypeSystem::generate_deftype_for_structure(const StructureType* st) const {
std::string result;
result += fmt::format("(deftype {} ({})\n", st->get_name(), st->get_parent());
@@ -2004,10 +2191,10 @@ std::string TypeSystem::generate_deftype_for_structure(const StructureType* st)
int longest_field_name = 0;
int longest_type_name = 0;
int longest_mods = 0;
int longest_mods_with_user_placed = 0;
const std::string inline_string = ":inline";
const std::string dynamic_string = ":dynamic";
bool has_offset_assert = false;
// calculate longest strings needed, for basic linting
@@ -2021,33 +2208,33 @@ std::string TypeSystem::generate_deftype_for_structure(const StructureType* st)
// normal fields
for (size_t i = st->first_unique_field_idx(); i < st->fields().size(); i++) {
const auto& field = st->fields().at(i);
longest_field_name = std::max(longest_field_name, int(field.name().size()));
longest_type_name = std::max(longest_type_name, int(field.type().print().size()));
int mods = 0;
// mods are array size, :inline, :dynamic
if (field.is_array() && !field.is_dynamic()) {
mods++;
mods += std::to_string(field.array_size()).size();
}
if (field.is_inline()) {
if (mods) {
mods++; // space
}
mods++; // space
mods += inline_string.size();
}
if (field.is_dynamic()) {
if (mods) {
mods++; // space
}
mods++; // space
mods += dynamic_string.size();
}
if (!field.user_placed()) {
has_offset_assert = true;
longest_field_name = std::max(longest_field_name, int(field.name().size()));
if (mods > 0 || field.user_placed()) {
// this is only relevant for fields that have mods
longest_type_name = std::max(longest_type_name, int(field.type().print().size()));
}
longest_mods = std::max(longest_mods, mods);
if (field.user_placed()) {
longest_mods_with_user_placed = std::max(longest_mods_with_user_placed, mods);
}
}
// now actually write out the fields
@@ -2057,10 +2244,9 @@ std::string TypeSystem::generate_deftype_for_structure(const StructureType* st)
const auto& field = st->fields().at(i);
result += "(";
result += field.name();
result.append(1 + (longest_field_name - int(field.name().size())), ' ');
result.append(2 + (longest_field_name - int(field.name().size())), ' ');
result += field.type().print();
result.append(1 + (longest_type_name - int(field.type().print().size())), ' ');
result.append(1 + longest_mods, ' ');
result.append(":override)\n ");
}
@@ -2069,40 +2255,51 @@ std::string TypeSystem::generate_deftype_for_structure(const StructureType* st)
const auto& field = st->fields().at(i);
result += "(";
result += field.name();
result.append(1 + (longest_field_name - int(field.name().size())), ' ');
result.append(2 + (longest_field_name - int(field.name().size())), ' ');
result += field.type().print();
result.append(1 + (longest_type_name - int(field.type().print().size())), ' ');
std::string mods;
if (field.is_array() && !field.is_dynamic()) {
mods += std::to_string(field.array_size());
mods += " ";
mods += std::to_string(field.array_size());
}
if (field.is_inline()) {
mods += inline_string;
mods += " ";
mods += inline_string;
}
if (field.is_dynamic()) {
mods += dynamic_string;
mods += " ";
mods += dynamic_string;
}
if (!mods.empty()) {
result.append(1 + longest_type_name - int(field.type().print().size()), ' ');
}
result.append(mods);
result.append(longest_mods - int(mods.size() - 1), ' ');
if (!field.user_placed()) {
result.append(":offset-assert ");
} else {
if (has_offset_assert) {
result.append(":offset ");
if (field.user_placed()) {
result.append(longest_mods_with_user_placed - int(mods.size()), ' ');
if (mods.empty()) {
result.append(1 + longest_type_name - int(field.type().print().size()), ' ');
}
// find best field for :overlay-at
// we find the first field that does not come after the current one
// and either use it, or check if one of its fields (recursively) is appropriate
// we also check for array offsets. we ALSO do bounds-checking!
// non-fixed offset fields get priority! dynamic fields are IGNORED.
// if all else fails, print as fixed offset.
auto best_match = find_best_field_in_structure(*this, st, field.offset(), field, false, 0, i);
if (!best_match) {
result.append(fmt::format(" :offset {:3d}", field.offset()));
} else if (best_match->find(' ') == std::string::npos) {
result.append(fmt::format(" :overlay-at {}", *best_match));
} else {
result.append(":offset ");
result.append(fmt::format(" :overlay-at (-> {})", *best_match));
}
}
result.append(fmt::format("{:3d}", field.offset()));
result.append(")\n ");
}
+7 -4
View File
@@ -161,8 +161,7 @@ class TypeSystem {
int get_load_size_allow_partial_def(const TypeSpec& ts) const;
MethodInfo override_method(Type* type,
const std::string& type_name,
const int method_id,
const std::string& method_name,
const std::optional<std::string>& docstring);
MethodInfo declare_method(const std::string& type_name,
const std::string& method_name,
@@ -175,8 +174,12 @@ class TypeSystem {
const std::optional<std::string>& docstring,
bool no_virtual,
const TypeSpec& ts,
bool override_type,
int id = -1);
bool override_type);
MethodInfo overlay_method(Type* type,
const std::string& method_name,
const std::string& method_overlay_name,
const std::optional<std::string>& docstring,
const TypeSpec& ts);
MethodInfo define_method(const std::string& type_name,
const std::string& method_name,
const TypeSpec& ts,
+118 -34
View File
@@ -136,14 +136,65 @@ void add_field(
throw std::runtime_error(fmt::format("Field {} not found to override", name));
}
} else if (opt_name == ":overlay-at") {
auto field_name = symbol_string(car(rest));
Field overlay_field;
if (!structure->lookup_field(field_name, &overlay_field)) {
throw std::runtime_error(
fmt::format("Field {} not found to overlay for {}", field_name, name));
}
offset_override = overlay_field.offset();
const auto& param = car(rest);
rest = cdr(rest);
Field overlay_field;
if (param.is_symbol()) {
auto field_name = symbol_string(param);
if (!structure->lookup_field(field_name, &overlay_field)) {
throw std::runtime_error(
fmt::format("Field {} not found to overlay for {}", field_name, name));
}
offset_override = overlay_field.offset();
} else if (param.is_pair() && car(&param).is_symbol("->")) {
auto name_it = cdr(&param);
if (name_it->is_empty_list()) {
throw std::runtime_error(
fmt::format("Field list for overlay-at in {} was empty", name));
}
auto type_to_use = structure;
offset_override = 0;
while (!name_it->is_empty_list()) {
const auto& deref_field = car(name_it);
if (deref_field.is_int()) {
auto ref_array_field = !type_to_use && !overlay_field.is_inline()
? ts->lookup_type_allow_partial_def(overlay_field.type())
: nullptr;
if (ref_array_field) {
// we can have an array of references (non-inline) to a forward-declared type
offset_override += ref_array_field->get_load_size() * deref_field.as_int();
} else {
auto type_to_deref = type_to_use && overlay_field.is_inline()
? TypeSpec("inline-array")
: TypeSpec("pointer");
type_to_deref.add_arg(overlay_field.type());
auto deref_info = ts->get_deref_info(type_to_deref);
if (!deref_info.can_deref) {
throw std::runtime_error(
fmt::format("Array could not be dereferenced for overlay-at in {}", name));
}
// overlay_field.type() = deref_info.result_type;
offset_override += deref_info.stride * deref_field.as_int();
}
} else {
if (!type_to_use) {
throw std::runtime_error(
fmt::format("Field {} not inside a structure for overlay-at in {}",
overlay_field.name(), name));
}
auto field_name = symbol_string(car(name_it));
if (!type_to_use->lookup_field(field_name, &overlay_field)) {
throw std::runtime_error(
fmt::format("Field {} not found to overlay for {}", field_name, name));
}
type_to_use = dynamic_cast<StructureType*>(ts->lookup_type(overlay_field.type()));
offset_override += overlay_field.offset();
}
name_it = cdr(name_it);
}
} else {
throw std::runtime_error(fmt::format("Unknown parameter for overlay-at in {}", name));
}
} else if (opt_name == ":score") {
score = get_float(car(rest));
rest = cdr(rest);
@@ -276,14 +327,20 @@ void declare_method(Type* type,
// - this effectively does a :replace without having to re-define the name and signature and
// keep that in-sync
std::string method_name;
std::string method_overlay_name;
TypeSpec function_typespec("function");
std::optional<std::string> docstring;
goos::Object args;
goos::Object return_type;
bool no_virtual = false;
bool replace_method = false;
bool overlay_method = false;
bool overriding_doc = false;
// name
method_name = symbol_string(car(obj));
obj = cdr(obj);
if (!obj->is_empty_list() && car(obj).is_symbol(":override-doc")) {
obj = cdr(obj);
if (car(obj).is_string()) {
@@ -296,10 +353,6 @@ void declare_method(Type* type,
}
if (!overriding_doc) {
// name
method_name = symbol_string(car(obj));
obj = cdr(obj);
// docstring
if (obj->is_pair() && car(obj).is_string()) {
docstring = str_util::trim_newline_indents(car(obj).as_string()->data);
@@ -325,13 +378,9 @@ void declare_method(Type* type,
} else if (keyword == ":replace") {
replace_method = true;
} else if (keyword == ":state") {
auto behavior_tag = function_typespec.try_get_tag("behavior");
function_typespec = TypeSpec("state");
if (behavior_tag) {
function_typespec.add_new_tag("behavior", behavior_tag.value());
}
// parse state docstrings if available
if (car(cdr(obj)).is_list()) {
if (!cdr(obj)->is_empty_list() && car(cdr(obj)).is_list()) {
obj = cdr(obj);
auto docstring_list = &car(obj);
auto elem = docstring_list;
@@ -362,6 +411,13 @@ void declare_method(Type* type,
throw std::runtime_error("Bad usage of :behavior in a method declaration");
}
function_typespec.add_new_tag("behavior", symbol_string(obj->as_pair()->car));
} else if (keyword == ":overlay-at") {
obj = cdr(obj);
if (!car(obj).is_symbol()) {
throw std::runtime_error("Invalid parameter to method overlay-at");
}
method_overlay_name = symbol_string(car(obj));
overlay_method = true;
}
obj = cdr(obj);
}
@@ -373,36 +429,62 @@ void declare_method(Type* type,
function_typespec.add_arg(parse_typespec(type_system, return_type));
}
// determine the method id, it should be the last in the list
int id = -1;
if (!obj->is_empty_list() && car(obj).is_int()) {
auto& id_obj = car(obj);
id = get_int(id_obj);
obj = cdr(obj);
if (!obj->is_empty_list()) {
throw std::runtime_error(fmt::format("found unknown data in a method declaration:\n{}\n\n{}",
obj->print(), _obj.print()));
}
if (!obj->is_empty_list()) {
throw std::runtime_error("found symbols after the `id` in a method defintion: " +
def.print());
if (overlay_method && (no_virtual || replace_method)) {
throw std::runtime_error(
fmt::format("method {} in type {} has invalid combination of keywords", method_name,
type->get_name()));
}
MethodInfo info;
if (overriding_doc) {
info = type_system->override_method(type, method_name, id, docstring);
info = type_system->override_method(type, method_name, docstring);
} else if (overlay_method) {
info = type_system->overlay_method(type, method_name, method_overlay_name, docstring,
function_typespec);
} else {
info = type_system->declare_method(type, method_name, docstring, no_virtual,
function_typespec, replace_method, id);
function_typespec, replace_method);
}
});
}
// check the method assert
if (id != -1) {
// method id assert!
if (id != info.id) {
lg::print("WARNING - ID assert failed on method {} of type {} (wanted {} got {})\n",
method_name.c_str(), type->get_name().c_str(), id, info.id);
throw std::runtime_error("Method ID assert failed");
void declare_state_methods(Type* type,
TypeSystem* type_system,
const goos::Object& def,
StructureDefResult& struct_def) {
for_each_in_list(def, [&](const goos::Object& _obj) {
auto obj = &_obj;
// either state-name or (state-name args...) or (state-name "docstring" args...)
std::string method_name;
TypeSpec function_typespec("state");
std::optional<std::string> docstring;
if (obj->is_symbol()) {
method_name = obj->as_symbol().name_ptr;
} else if (obj->is_list()) {
if (!car(obj).is_symbol()) {
throw std::runtime_error(
fmt::format("{} is not a valid name for a state-method", obj->print()));
}
method_name = car(obj).as_symbol().name_ptr;
auto& args = *cdr(obj);
if (car(obj).is_string()) {
// docstring first
docstring = car(obj).as_string()->data;
obj = cdr(obj);
}
for_each_in_list(args, [&](const goos::Object& o) {
function_typespec.add_arg(parse_typespec(type_system, o));
});
}
function_typespec.add_arg(TypeSpec("_type_"));
type_system->declare_method(type, method_name, docstring, false, function_typespec, false);
});
}
@@ -492,6 +574,8 @@ StructureDefResult parse_structure_def(
declare_method(type, ts, *opt_list, result);
} else if (list_name == ":states") {
declare_state(type, ts, *opt_list, result);
} else if (list_name == ":state-methods") {
declare_state_methods(type, ts, *opt_list, result);
} else {
throw std::runtime_error("Invalid option list in field specification: " +
car(rest).print());
+38 -10
View File
@@ -1643,31 +1643,59 @@ std::string TypeInspectorResult::print_as_deftype(
}
if (type_method_count > 9) {
result.append("(:methods\n ");
std::string methods_list;
std::string state_methods_list;
MethodInfo old_new_method;
if (old_game_type && old_game_type->get_my_new_method(&old_new_method)) {
result.append(old_method_string(old_new_method));
result.append("\n ");
methods_list.append(" ");
methods_list.append(old_method_string(old_new_method));
methods_list.push_back('\n');
}
bool done_with_state_methods = false;
for (int i = parent_method_count; i < type_method_count; i++) {
// If the method is actually a state, skip it!
bool print_as_state_method = false;
if (method_states.count(i) != 0) {
result.append(fmt::format("({} () _type_ :state {})", method_states.at(i), i));
if (!done_with_state_methods) {
print_as_state_method = true;
state_methods_list.append(fmt::format(" {}", method_states.at(i)));
} else {
methods_list.append(
fmt::format(" ({} () _type_ :state) ;; {}", method_states.at(i), i));
}
} else {
result.append(fmt::format("({}-method-{} () none {})", type_name, i, i));
done_with_state_methods = true;
methods_list.append(fmt::format(" ({}-method-{} () none) ;; {}", type_name, i, i));
}
if (old_game_type) {
MethodInfo info;
if (old_game_type->get_my_method(i, &info)) {
result += old_method_string(info);
if (print_as_state_method) {
state_methods_list += old_method_string(info);
} else {
methods_list += old_method_string(info);
}
}
}
result.append("\n ");
if (print_as_state_method) {
state_methods_list.push_back('\n');
} else {
methods_list.push_back('\n');
}
}
if (!state_methods_list.empty()) {
result.append("(:state-methods\n");
result.append(state_methods_list);
result.append(" )\n ");
}
if (!methods_list.empty()) {
result.append("(:methods");
result.append(methods_list);
result.append(" )\n ");
}
result.append(")\n ");
}
// Print out states if we have em
// Print out (normal) states if we have em
// - Could probably assume the process name comes first and associate it with the right type
// but that may or may not be risky so, edit the types yourself...
if (method_states.size() > 0) {
+3 -1
View File
@@ -178,7 +178,9 @@ std::string final_defun_out(const Function& func,
auto method_info =
dts.ts.lookup_method(func.guessed_name.type_name, func.guessed_name.method_id);
top.push_back(pretty_print::to_symbol(method_info.name));
top.push_back(pretty_print::to_symbol(func.guessed_name.type_name));
if (method_info.name == "new") {
top.push_back(pretty_print::to_symbol(func.guessed_name.type_name));
}
top.push_back(arguments);
auto top_form = pretty_print::build_list(top);
File diff suppressed because it is too large Load Diff
@@ -9,9 +9,7 @@
// you want to run on the entire game.
"dgo_names": [
"CGO/KERNEL.CGO",
"CGO/ENGINE.CGO",
"CGO/GAME.CGO",
"CGO/ART.CGO",
"DGO/BEA.DGO",
"DGO/CIT.DGO",
"CGO/COMMON.CGO",
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -110,7 +110,7 @@ void DecompilerTypeSystem::parse_type_defs(const std::vector<std::string>& file_
} catch (std::exception& e) {
auto info = m_reader.db.get_info_for(o);
lg::error("{} when parsing decompiler type file:{}", e.what(), info);
throw e;
throw;
}
});
}
+17 -1
View File
@@ -21,7 +21,7 @@
"Make Debug Asm Only: make + print disassembly (asm-only mode) for a file"
(if (null? path)
`(asm-file ,file :color :write :disassemble :disasm-code-only)
`(asm-file ,file :color :write :disassemble :disasm-code-only ,(first path))
`(asm-file ,file :color :write :disassemble ,(first path) :disasm-code-only)
)
)
@@ -292,6 +292,22 @@
)
)
(defmacro defun-debug-recursive (name return-type bindings &rest body)
`(begin
(define-extern ,name
(function ,@(apply (lambda (x)
(if (pair? x)
(second x)
'object)
)
bindings)
,return-type))
(if *debug-segment*
(defun-debug ,name ,bindings ,@body)
(define :no-typecheck #t ,name nothing))
)
)
(defmacro define-once (name value)
"define once. Does not set the symbol if it already has a value. It must have been at least forward-declared first!"
`(begin
+20 -24
View File
@@ -32,39 +32,35 @@
;; DECOMP BEGINS
(deftype align-control (basic)
((flags align-flags :offset-assert 4)
(process process-drawable :offset-assert 8)
(frame-group art-joint-anim :offset-assert 12)
(frame-num float :offset-assert 16)
(matrix matrix 2 :inline :offset-assert 32)
(transform transform 2 :inline :offset-assert 160)
(delta transformq :inline :offset-assert 256)
(last-speed meters :offset-assert 304)
(align transformq :inline :offset 160)
((flags align-flags)
(process process-drawable)
(frame-group art-joint-anim)
(frame-num float)
(matrix matrix 2 :inline)
(transform transform 2 :inline)
(delta transformq :inline)
(last-speed meters)
(align transformq :inline :overlay-at (-> transform 0 trans x))
)
:method-count-assert 14
:size-assert #x134
:flag-assert #xe00000134
(:methods
(new (symbol type process) _type_ :behavior process-drawable 0)
(compute-alignment! (_type_) transformq 9)
(align! (_type_ align-opts float float float) trsqv 10)
(align-vel-and-quat-only! (_type_ align-opts vector int float float) trsqv 11) ;; 3rd arg is unused
(first-transform (_type_) transform 12)
(snd-transform (_type_) transform 13)
(new (symbol type process-drawable) _type_)
(compute-alignment! (_type_) transformq)
(align! (_type_ align-opts float float float) trsqv)
(align-vel-and-quat-only! (_type_ align-opts vector int float float) trsqv)
(first-transform (_type_) transform)
(snd-transform (_type_) transform)
)
)
(defmethod new align-control ((allocation symbol) (type-to-make type) (proc process))
(defmethod new align-control ((allocation symbol) (type-to-make type) (proc process-drawable))
"Create a new align-control."
(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 align-control 0))
)
(set! (-> obj process) (the-as process-drawable proc))
obj
(set! (-> this process) proc)
this
)
)
+6 -6
View File
@@ -9,7 +9,7 @@
;; 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))
(defmethod compute-alignment! ((this align-control))
(local-vars (a0-9 symbol) (s7-0 none) (ra-0 int))
(with-pp
(let ((s5-0 (-> this process skel active-channels)))
@@ -115,15 +115,15 @@
)
)
(defmethod first-transform align-control ((this align-control))
(defmethod first-transform ((this align-control))
(the-as transform (-> this transform))
)
(defmethod snd-transform align-control ((this align-control))
(defmethod snd-transform ((this align-control))
(-> this transform 1)
)
(defmethod align! align-control ((this align-control) (arg0 align-opts) (arg1 float) (arg2 float) (arg3 float))
(defmethod align! ((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))
@@ -140,7 +140,7 @@
(-> this process root)
)
(defmethod set-and-limit-velocity trsqv ((this trsqv) (arg0 int) (arg1 vector) (arg2 float))
(defmethod set-and-limit-velocity ((this trsqv) (arg0 int) (arg1 vector) (arg2 float))
(let ((gp-0 (-> this transv)))
(when (logtest? arg0 4)
(set! (-> gp-0 x) (-> arg1 x))
@@ -153,7 +153,7 @@
this
)
(defmethod align-vel-and-quat-only! align-control ((this align-control) (arg0 align-opts) (arg1 vector) (arg2 int) (arg3 float) (arg4 float))
(defmethod align-vel-and-quat-only! ((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)))
+59 -81
View File
@@ -8,112 +8,90 @@
;; DECOMP BEGINS
(deftype joint-exploder-tuning (structure)
((explosion uint64 :offset-assert 0)
(duration time-frame :offset-assert 8)
(gravity float :offset-assert 16)
(rot-speed float :offset-assert 20)
(fountain-rand-transv-lo vector :inline :offset-assert 32)
(fountain-rand-transv-hi vector :inline :offset-assert 48)
(away-from-focal-pt vector :inline :offset 32)
(away-from-rand-transv-xz-lo float :offset 48)
(away-from-rand-transv-xz-hi float :offset 52)
(away-from-rand-transv-y-lo float :offset 56)
(away-from-rand-transv-y-hi float :offset 60)
((explosion uint64)
(duration time-frame)
(gravity float)
(rot-speed float)
(fountain-rand-transv-lo vector :inline)
(fountain-rand-transv-hi vector :inline)
(away-from-focal-pt vector :inline :overlay-at fountain-rand-transv-lo)
(away-from-rand-transv-xz-lo float :overlay-at (-> fountain-rand-transv-hi x))
(away-from-rand-transv-xz-hi float :overlay-at (-> fountain-rand-transv-hi y))
(away-from-rand-transv-y-lo float :overlay-at (-> fountain-rand-transv-hi z))
(away-from-rand-transv-y-hi float :overlay-at (-> fountain-rand-transv-hi w))
)
:method-count-assert 9
:size-assert #x40
:flag-assert #x900000040
(:methods
(new (symbol type int) _type_ 0)
(new (symbol type int) _type_)
)
)
(deftype joint-exploder-static-joint-params (structure)
((joint-index int16 :offset-assert 0)
(parent-joint-index int16 :offset-assert 2)
((joint-index int16)
(parent-joint-index int16)
)
:method-count-assert 9
:size-assert #x4
:flag-assert #x900000004
)
(deftype joint-exploder-static-params (basic)
((joints (array joint-exploder-static-joint-params) :offset-assert 4)
((joints (array joint-exploder-static-joint-params))
)
:method-count-assert 9
:size-assert #x8
:flag-assert #x900000008
)
(deftype joint-exploder-joint (structure)
((next int16 :offset-assert 0)
(prev int16 :offset-assert 2)
(joint-index int16 :offset-assert 4)
(rspeed float :offset-assert 8)
(mat matrix :inline :offset-assert 16)
(rmat matrix :inline :offset-assert 80)
(transv vector :inline :offset-assert 144)
(prev-pos vector :inline :offset-assert 160)
((next int16)
(prev int16)
(joint-index int16)
(rspeed float)
(mat matrix :inline)
(rmat matrix :inline)
(transv vector :inline)
(prev-pos vector :inline)
)
:method-count-assert 9
:size-assert #xb0
:flag-assert #x9000000b0
)
(deftype joint-exploder-joints (basic)
((num-joints int32 :offset-assert 4)
(joint joint-exploder-joint :inline :dynamic :offset 16)
((num-joints int32)
(joint joint-exploder-joint :inline :dynamic :offset 16)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
(:methods
(new (symbol type joint-exploder-static-params) _type_ 0)
(new (symbol type joint-exploder-static-params) _type_)
)
)
(deftype joint-exploder-list (structure)
((head int32 :offset-assert 0)
(pre-moved? symbol :offset-assert 4)
(bbox-valid? symbol :offset-assert 8)
(bbox bounding-box :inline :offset-assert 16)
((head int32)
(pre-moved? symbol)
(bbox-valid? symbol)
(bbox bounding-box :inline)
)
:method-count-assert 9
:size-assert #x30
:flag-assert #x900000030
)
(deftype joint-exploder (process-drawable)
((parent-override (pointer process-drawable) :offset 12)
(die-if-below-y float :offset-assert 176)
(die-if-beyond-xz-dist-sqrd float :offset-assert 180)
(joints joint-exploder-joints :offset-assert 184)
(static-params joint-exploder-static-params :offset-assert 188)
(anim art-joint-anim :offset-assert 192)
(scale-vector vector :inline :offset-assert 208)
(tuning joint-exploder-tuning :inline :offset-assert 224)
(lists joint-exploder-list 5 :inline :offset-assert 288)
((parent-override (pointer process-drawable) :overlay-at parent)
(die-if-below-y float)
(die-if-beyond-xz-dist-sqrd float)
(joints joint-exploder-joints)
(static-params joint-exploder-static-params)
(anim art-joint-anim)
(scale-vector vector :inline)
(tuning joint-exploder-tuning :inline)
(lists joint-exploder-list 5 :inline)
)
:heap-base #x1a0
:method-count-assert 29
:size-assert #x210
:flag-assert #x1d01a00210
(:methods
(joint-exploder-method-20 (_type_ joint-exploder-list int) int 20)
(joint-exploder-method-21 (_type_ joint-exploder-list joint-exploder-joint) none 21)
(joint-exploder-method-22 (_type_ joint-exploder-list) symbol 22)
(joint-exploder-method-23 (_type_) symbol 23)
(joint-exploder-method-24 (_type_ joint-exploder-list int) int 24)
(joint-exploder-method-25 (_type_ joint-exploder-list) symbol 25)
(joint-exploder-method-26 (_type_ joint-exploder-list int) int 26)
(joint-exploder-method-27 (_type_ joint-exploder-list int) joint-exploder-list 27)
(joint-exploder-method-28 (_type_ joint-exploder-list) none 28)
(joint-exploder-method-20 (_type_ joint-exploder-list int) int)
(joint-exploder-method-21 (_type_ joint-exploder-list joint-exploder-joint) none)
(joint-exploder-method-22 (_type_ joint-exploder-list) symbol)
(joint-exploder-method-23 (_type_) symbol)
(joint-exploder-method-24 (_type_ joint-exploder-list int) int)
(joint-exploder-method-25 (_type_ joint-exploder-list) symbol)
(joint-exploder-method-26 (_type_ joint-exploder-list int) int)
(joint-exploder-method-27 (_type_ joint-exploder-list int) joint-exploder-list)
(joint-exploder-method-28 (_type_ joint-exploder-list) none)
)
(:states
joint-exploder-shatter
@@ -121,7 +99,7 @@
)
(defmethod asize-of joint-exploder-joints ((this joint-exploder-joints))
(defmethod asize-of ((this joint-exploder-joints))
(the-as int (+ (-> this type size) (* 176 (-> this num-joints))))
)
@@ -157,7 +135,7 @@
(none)
)
(defmethod joint-exploder-method-24 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int))
(defmethod joint-exploder-method-24 ((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))
@@ -171,7 +149,7 @@
)
)
(defmethod joint-exploder-method-26 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int))
(defmethod joint-exploder-method-26 ((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))
@@ -202,7 +180,7 @@
)
)
(defmethod joint-exploder-method-20 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int))
(defmethod joint-exploder-method-20 ((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 +195,7 @@
)
)
(defmethod joint-exploder-method-21 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 joint-exploder-joint))
(defmethod joint-exploder-method-21 ((this joint-exploder) (arg0 joint-exploder-list) (arg1 joint-exploder-joint))
(let ((a1-1 (-> arg1 mat vector 3)))
(cond
((-> arg0 bbox-valid?)
@@ -234,7 +212,7 @@
(none)
)
(defmethod joint-exploder-method-27 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int))
(defmethod joint-exploder-method-27 ((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))
@@ -331,7 +309,7 @@
)
)
(defmethod joint-exploder-method-28 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list))
(defmethod joint-exploder-method-28 ((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)))
@@ -363,7 +341,7 @@
(none)
)
(defmethod joint-exploder-method-25 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list))
(defmethod joint-exploder-method-25 ((this joint-exploder) (arg0 joint-exploder-list))
(set! (-> arg0 bbox-valid?) #f)
(set! (-> arg0 pre-moved?) #t)
(let ((s4-0 (-> this joints))
@@ -406,7 +384,7 @@
#f
)
(defmethod joint-exploder-method-22 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list))
(defmethod joint-exploder-method-22 ((this joint-exploder) (arg0 joint-exploder-list))
(fill-using-bounding-box
*collide-cache*
(-> arg0 bbox)
@@ -526,7 +504,7 @@
:post ja-post
)
(defmethod joint-exploder-method-23 joint-exploder ((this joint-exploder))
(defmethod joint-exploder-method-23 ((this joint-exploder))
(let ((gp-0 (-> this joints)))
(dotimes (s4-0 (-> gp-0 num-joints))
(let ((v1-2 (-> this static-params joints s4-0))
@@ -622,7 +600,7 @@
)
)
(defmethod relocate joint-exploder ((this joint-exploder) (arg0 int))
(defmethod relocate ((this joint-exploder) (arg0 int))
(if (nonzero? (-> this joints))
(&+! (-> this joints) arg0)
)
+58 -78
View File
@@ -35,107 +35,87 @@
;; A single joint control channel. It can control some number of joints through a single animation.
;; Multiple channels are blended together to create smooth transitions between animations.
(deftype joint-control-channel (structure)
((parent joint-control :offset-assert 0)
(command symbol :offset-assert 4)
(frame-interp float :offset-assert 8)
(frame-group art-joint-anim :offset-assert 12)
(frame-num float :offset-assert 16)
(num-func (function joint-control-channel float float float) :offset-assert 20)
(param float 2 :offset-assert 24)
(group-sub-index int16 :offset-assert 32)
(group-size int16 :offset-assert 34)
(dist meters :offset-assert 36)
(eval-time uint32 :offset-assert 40)
(inspector-amount float :offset-assert 44)
((parent joint-control)
(command symbol)
(frame-interp float)
(frame-group art-joint-anim)
(frame-num float)
(num-func (function joint-control-channel float float float))
(param float 2)
(group-sub-index int16)
(group-size int16)
(dist meters)
(eval-time uint32)
(inspector-amount float)
)
:method-count-assert 10
:size-assert #x30
:flag-assert #xa00000030
(:methods
(debug-print-frames (_type_) _type_ 9)
(debug-print-frames (_type_) _type_)
)
)
;; 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)
(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)
(allocated-length int16)
(root-channel (inline-array joint-control-channel) :offset 16)
(blend-index int32)
(active-channels int32)
(generate-frame-function (function (inline-array vector) int process-drawable int))
(prebind-function (function pointer int process-drawable none))
(postbind-function (function process-drawable none))
(effect effect-control)
(channel joint-control-channel 3 :inline)
(frame-group0 art-joint-anim :overlay-at (-> channel 0 frame-group))
(frame-num0 float :overlay-at (-> channel 0 frame-num))
(frame-interp0 float :overlay-at (-> channel 0 frame-interp))
(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
:flag-assert #xb000000c0
(:methods
(new (symbol type int) _type_ 0)
(current-cycle-distance (_type_) float 9)
(debug-print-channels (_type_ symbol) int 10)
(new (symbol type int) _type_)
(current-cycle-distance (_type_) float)
(debug-print-channels (_type_ symbol) int)
)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; joint anim decompress
;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; these types are used to decompress joint animations.
(deftype matrix-stack (structure)
((top matrix :offset-assert 0)
(data matrix 24 :inline :offset-assert 16)
((top matrix)
(data matrix 24 :inline)
)
:method-count-assert 9
:size-assert #x610
:flag-assert #x900000610
)
(deftype channel-upload-info (structure)
((fixed joint-anim-compressed-fixed :offset-assert 0)
(fixed-qwc int32 :offset-assert 4)
(frame joint-anim-compressed-frame :offset-assert 8)
(frame-qwc int32 :offset-assert 12)
(amount float :offset-assert 16)
(interp float :offset-assert 20)
((fixed joint-anim-compressed-fixed)
(fixed-qwc int32)
(frame joint-anim-compressed-frame)
(frame-qwc int32)
(amount float)
(interp float)
)
:pack-me
:method-count-assert 9
:size-assert #x18
:flag-assert #x900000018
)
(deftype joint-work (structure)
((temp-mtx matrix :inline :offset-assert 0)
(joint-stack matrix-stack :inline :offset-assert 64)
(fix-jmp-table (function none) 16 :offset-assert 1616)
(frm-jmp-table (function none) 16 :offset-assert 1680)
(pair-jmp-table (function none) 16 :offset-assert 1744)
(uploads channel-upload-info 24 :inline :offset-assert 1808)
(num-uploads int32 :offset-assert 2384)
(mtx-acc matrix 2 :inline :offset-assert 2400)
(tq-acc transformq 100 :inline :offset-assert 2528)
(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)
(flattened vector 24 :inline :offset 2400)
((temp-mtx matrix :inline)
(joint-stack matrix-stack :inline)
(fix-jmp-table (function none) 16)
(frm-jmp-table (function none) 16)
(pair-jmp-table (function none) 16)
(uploads channel-upload-info 24 :inline)
(num-uploads int32)
(mtx-acc matrix 2 :inline)
(tq-acc transformq 100 :inline)
(jacp-hdr joint-anim-compressed-hdr :inline)
(fixed-data joint-anim-compressed-fixed :inline)
(frame-data joint-anim-compressed-frame 2 :inline)
(flatten-array float 576 :overlay-at mtx-acc)
(flattened vector 24 :inline :overlay-at mtx-acc)
)
:method-count-assert 9
:size-assert #x3640
:flag-assert #x900003640
)
+83 -99
View File
@@ -34,38 +34,35 @@
;; Although the mode is a bitfield, it appears that multiple kinds of mods cannot be
;; activated at the same time.
(deftype joint-mod (basic)
((mode joint-mod-handler-mode :offset-assert 4)
(process process-drawable :offset-assert 8)
(joint cspace :offset-assert 12)
(target vector :inline :offset-assert 16)
(twist vector :inline :offset-assert 32)
(twist-max vector :inline :offset-assert 48)
(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)
(flex-blend float :offset-assert 120)
(blend float :offset-assert 124)
(max-dist meters :offset-assert 128)
(ignore-angle degrees :offset-assert 132)
(up uint8 :offset-assert 136)
(nose uint8 :offset-assert 137)
(ear uint8 :offset-assert 138)
(shutting-down? symbol :offset-assert 140)
(parented-scale? symbol :offset 128)
((mode joint-mod-handler-mode)
(process process-drawable)
(joint cspace)
(target vector :inline)
(twist vector :inline)
(twist-max vector :inline)
(trans vector :inline)
(quat quaternion :inline)
(scale vector :inline)
(notice-time time-frame)
(flex-blend float)
(blend float)
(max-dist meters)
(ignore-angle degrees)
(up uint8)
(nose uint8)
(ear uint8)
(shutting-down? symbol)
(parented-scale? symbol :overlay-at max-dist)
)
:method-count-assert 16
: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_)
(set-mode! (_type_ joint-mod-handler-mode) _type_)
(set-target! (_type_ vector) none)
(look-at-enemy! (_type_ vector symbol process) none)
(reset-blend! (_type_) _type_)
(set-twist! (_type_ float float float) vector)
(set-trs! (_type_ vector quaternion vector) none)
(shut-down! (_type_) none)
)
)
@@ -78,27 +75,32 @@
(none)
)
(defmethod new joint-mod ((allocation symbol) (type-to-make type) (mode joint-mod-handler-mode) (proc process-drawable) (joint-idx int))
(defmethod new joint-mod ((allocation symbol)
(type-to-make type)
(mode joint-mod-handler-mode)
(proc process-drawable)
(joint-idx int)
)
"Construct a new joint-mod. It will work on the given process-drawable's joint."
(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)
;; grab the joint from our node-list.
(set! (-> obj joint) (-> (-> proc node-list) data joint-idx))
(set-mode! obj mode)
(set! (-> this joint) (-> proc node-list data joint-idx))
(set-mode! this mode)
;; set defaults.
(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
(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
)
)
(defmethod set-mode! joint-mod ((this joint-mod) (handler-mode joint-mod-handler-mode))
(defmethod set-mode! ((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! (-> this mode) handler-mode)
(let ((joint (-> this joint)))
@@ -156,20 +158,20 @@
this
)
(defmethod reset-blend! joint-mod ((this joint-mod))
(defmethod reset-blend! ((this joint-mod))
"Reset the blend to 0."
(set! (-> this blend) 0.0)
this
)
(defmethod shut-down! joint-mod ((this joint-mod))
(defmethod shut-down! ((this joint-mod))
"Shut down and set the blend to zero."
(set! (-> this shutting-down?) #t)
(set! (-> this blend) 0.0)
(none)
)
(defmethod set-twist! joint-mod ((this joint-mod) (x float) (y float) (z float))
(defmethod set-twist! ((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! (-> this twist x) x)
@@ -183,7 +185,7 @@
(-> this twist)
)
(defmethod set-trs! joint-mod ((this joint-mod) (trans vector) (rot quaternion) (scale vector))
(defmethod set-trs! ((this joint-mod) (trans vector) (rot quaternion) (scale vector))
(if trans
(set! (-> this trans quad) (-> trans quad))
)
@@ -197,7 +199,7 @@
(none)
)
(defmethod set-target! joint-mod ((this joint-mod) (target-trans vector))
(defmethod set-target! ((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 (= (-> this mode) (joint-mod-handler-mode reset))
@@ -218,20 +220,17 @@
;; 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)
(horz float)
(vert float)
)
:method-count-assert 9
:size-assert #x18
:flag-assert #x900000018
)
;; this is the last thing we tried to look at.
;; 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 ((this joint-mod) (target-trans vector) (option symbol) (proc process))
(defmethod look-at-enemy! ((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."
@@ -578,17 +577,14 @@
;; 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)
(angle float)
(process process-drawable)
(wheel-radius float)
(wheel-axis int8)
)
:method-count-assert 9
:size-assert #x2d
:flag-assert #x90000002d
(:methods
(new (symbol type process-drawable int float int) _type_ 0)
(new (symbol type process-drawable int float int) _type_)
)
)
@@ -636,17 +632,14 @@
)
(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)
(set-rotation symbol)
(set-scale symbol)
(set-translation symbol)
(enable symbol)
)
: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_)
)
)
@@ -699,15 +692,12 @@
)
(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)
(node-index int32)
(enable basic)
)
:method-count-assert 9
:size-assert #x48
:flag-assert #x900000048
(:methods
(new (symbol type process-drawable int basic) _type_ 0)
(new (symbol type process-drawable int basic) _type_)
)
)
@@ -738,17 +728,14 @@
)
(deftype joint-mod-blend-local (basic)
((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)
((transform transformq :inline)
(blend-transform transformq :inline)
(node-index int32)
(blend float)
(enable basic)
)
:method-count-assert 9
:size-assert #x7c
:flag-assert #x90000007c
(:methods
(new (symbol type process-drawable int basic) _type_ 0)
(new (symbol type process-drawable int basic) _type_)
)
)
@@ -792,16 +779,13 @@
)
(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)
(angle float)
(spin-rate float)
(enable basic)
)
:method-count-assert 9
:size-assert #x2c
:flag-assert #x90000002c
(:methods
(new (symbol type process-drawable int vector float) _type_ 0)
(new (symbol type process-drawable int vector float) _type_)
)
)
+100 -104
View File
@@ -14,12 +14,12 @@
;; Basic Methods for joint/joint-control
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defmethod print joint ((this joint))
(defmethod print ((this joint))
(format #t "#<~A ~S ~D @ #x~X>" (-> this type) (-> this name) (-> this number) this)
this
)
(defmethod mem-usage joint ((this joint) (arg0 memory-usage-block) (arg1 int))
(defmethod mem-usage ((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)
@@ -30,12 +30,12 @@
this
)
(defmethod print joint-anim ((this joint-anim))
(defmethod print ((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 ((this joint-anim))
(defmethod length ((this joint-anim))
(-> this length)
)
@@ -47,7 +47,7 @@
this
)
(defmethod asize-of joint-anim-matrix ((this joint-anim-matrix))
(defmethod asize-of ((this joint-anim-matrix))
(the-as int (+ (-> joint-anim-matrix size) (* (-> this length) 64)))
)
@@ -57,16 +57,16 @@
(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))
)
(format #t "~T [~D] ~`transformq`P~%" s5-0 (-> this data s5-0))
)
this
)
(defmethod asize-of joint-anim-transformq ((this joint-anim-transformq))
(defmethod asize-of ((this joint-anim-transformq))
(the-as int (+ (-> joint-anim-transformq size) (* 48 (-> this length))))
)
(defmethod asize-of joint-anim-drawable ((this joint-anim-drawable))
(defmethod asize-of ((this joint-anim-drawable))
(the-as int (+ (-> joint-anim-drawable size) (* (-> this length) 4)))
)
@@ -94,7 +94,7 @@
arg0
)
(defmethod mem-usage joint-anim-drawable ((this joint-anim-drawable) (arg0 memory-usage-block) (arg1 int))
(defmethod mem-usage ((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)
@@ -135,17 +135,19 @@
arg0
)
(defmethod print joint-control-channel ((this joint-control-channel))
(format #t "#<joint-control-channel ~A ~A ~F @ #x~X>"
(-> this command)
(-> this frame-group)
(-> this frame-num)
this
)
(defmethod print ((this joint-control-channel))
(format
#t
"#<joint-control-channel ~A ~A ~F @ #x~X>"
(-> this command)
(-> this frame-group)
(-> this frame-num)
this
)
this
)
(defmethod asize-of joint-control ((this joint-control))
(defmethod asize-of ((this joint-control))
(the-as int (+ (-> this type size) (* 48 (-> this allocated-length))))
)
@@ -167,7 +169,7 @@
)
)
(defmethod debug-print-frames joint-control-channel ((this joint-control-channel))
(defmethod debug-print-frames ((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 (-> this frame-group))
@@ -181,7 +183,7 @@
this
)
(defmethod debug-print-channels joint-control ((this joint-control) (arg0 symbol))
(defmethod debug-print-channels ((this joint-control) (arg0 symbol))
"Print each active channel to the given stream."
(dotimes (s4-0 (-> this active-channels))
(let* ((v1-6 (if (and (-> this channel s4-0 frame-group) (nonzero? (-> this channel s4-0 frame-group)))
@@ -236,30 +238,30 @@
;; art-mesh-anim: not used
;; art-joint-anim: used for animations. Provides joint-anim-compressed and eye-anim.
(defmethod needs-link? art ((this art))
(defmethod needs-link? ((this art))
#f
)
(defmethod lookup-art art ((this art) (arg0 string) (arg1 type))
(defmethod lookup-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 ((this art) (arg0 string) (arg1 type))
(defmethod lookup-idx-of-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 ((this art))
(defmethod print ((this art))
(format #t "#<~A ~S :length ~D @ #x~X>" (-> this type) (-> this name) (-> this length) this)
this
)
(defmethod length art ((this art))
(defmethod length ((this art))
(-> this length)
)
(defmethod login art ((this art))
(defmethod login ((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 (-> this extra) (zero? (-> this extra tag)))
@@ -268,7 +270,7 @@
this
)
(defmethod mem-usage art-mesh-anim ((this art-mesh-anim) (arg0 memory-usage-block) (arg1 int))
(defmethod mem-usage ((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)
@@ -285,12 +287,7 @@
this
)
(defmethod asize-of art-joint-anim ((this art-joint-anim))
(the-as int (+ (-> art size) (* (-> this length) 4)))
)
(defmethod mem-usage art-joint-anim ((this art-joint-anim) (arg0 memory-usage-block) (arg1 int))
(defmethod mem-usage ((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)
@@ -323,7 +320,10 @@
this
)
;; definition for method 3 of type art-group
(defmethod asize-of ((this art-joint-anim))
(the-as int (+ (-> art size) (* (-> this length) 4)))
)
(defmethod inspect art-group ((this art-group))
"Print the arts in an art-group"
(format #t "[~8x] ~A~%" this (-> this type))
@@ -333,15 +333,16 @@
(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)
(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)
)
)
)
this
)
(defmethod needs-link? art-group ((this art-group))
(defmethod needs-link? ((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 (-> this length)
@@ -351,7 +352,7 @@
)
)
(defmethod lookup-art art-group ((this art-group) (arg0 string) (arg1 type))
(defmethod lookup-art ((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
@@ -361,15 +362,13 @@
(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.
)
(or (name= arg0 (-> this data s2-0 name)) (string-charp= arg0 (&-> (-> this data s2-0 name) data s3-0))) ;; name is right. also seek past ag name, and try again.
)
(return (the-as joint (-> this data s2-0)))
)
)
)
(the-as art #f)
(the-as art-element #f)
)
(else
;; no type (also no weird after ag name check)
@@ -378,24 +377,23 @@
(return (the-as joint (-> this data s4-1)))
)
)
(the-as art #f)
(the-as art-element #f)
)
)
)
)
(defmethod lookup-idx-of-art art-group ((this art-group) (arg0 string) (arg1 type))
(defmethod lookup-idx-of-art ((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 (-> 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)))
)
(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)
)
)
@@ -413,7 +411,7 @@
)
)
(defmethod login art-group ((this art-group))
(defmethod login ((this art-group))
"Log in all the arts in a group."
(dotimes (s5-0 (-> this length))
(if (-> this data s5-0)
@@ -423,7 +421,7 @@
this
)
(defmethod mem-usage art-group ((this art-group) (arg0 memory-usage-block) (arg1 int))
(defmethod mem-usage ((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)
@@ -442,44 +440,44 @@
this
)
(defmethod relocate art-group ((this art-group) (arg0 kheap) (arg1 (pointer uint8)))
(defmethod relocate ((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! 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) ;; not part of level load, just normal login.
)
(if s5-1
(set-loaded-art (-> s5-1 art-group) this) ;; part of level load, add to level's ag, but don't log in yet.
)
)
this
((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) ;; not part of level load, just normal login.
)
(if s5-1
(set-loaded-art (-> s5-1 art-group) this) ;; part of level load, add to level's ag, but don't log in yet.
)
)
this
)
)
)
)
(none)
)
(defmethod asize-of art-mesh-geo ((this art-mesh-geo))
(defmethod asize-of ((this art-mesh-geo))
(the-as int (+ (-> art size) (* (-> this length) 4)))
)
(defmethod mem-usage art-mesh-geo ((this art-mesh-geo) (arg0 memory-usage-block) (arg1 int))
(defmethod mem-usage ((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)
@@ -496,18 +494,18 @@
this
)
(defmethod login art-joint-anim ((this art-joint-anim))
(defmethod login ((this art-joint-anim))
(if (and (-> this extra) (zero? (-> this extra tag)))
(set! (-> this extra tag) (&+ (the-as (pointer res-tag) (-> this extra)) 28))
)
this
)
(defmethod asize-of art-joint-geo ((this art-joint-geo))
(defmethod asize-of ((this art-joint-geo))
(the-as int (+ (-> art size) (* (-> this length) 4)))
)
(defmethod lookup-art art-joint-geo ((this art-joint-geo) (arg0 string) (arg1 type))
(defmethod lookup-art ((this art-joint-geo) (arg0 string) (arg1 type))
(cond
(arg1
(dotimes (s3-0 (-> this length))
@@ -528,7 +526,7 @@
)
)
(defmethod lookup-idx-of-art art-joint-geo ((this art-joint-geo) (arg0 string) (arg1 type))
(defmethod lookup-idx-of-art ((this art-joint-geo) (arg0 string) (arg1 type))
(cond
(arg1
(dotimes (s3-0 (-> this length))
@@ -549,7 +547,7 @@
)
)
(defmethod mem-usage art-joint-geo ((this art-joint-geo) (arg0 memory-usage-block) (arg1 int))
(defmethod mem-usage ((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)
@@ -573,7 +571,7 @@
(defun joint-control-channel-eval ((arg0 joint-control-channel))
"Run the joint control num-func callback, remember the current time"
((-> 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)
)
@@ -581,7 +579,7 @@
"Set the joint control num-func, and evaluate it."
(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)
)
@@ -596,7 +594,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
@@ -623,12 +621,13 @@
(set! (-> arg0 active-channels) (-> arg1 active-channels))
;; figure out which slot the source is, and remember that we're a copy.
(set! (-> arg0 root-channel)
(the-as (inline-array joint-control-channel)
(-> arg0
channel
(/ (&- (the-as pointer (-> arg1 root-channel)) (the-as uint (the-as pointer (-> arg1 channel)))) 48)
)
)
(the-as
(inline-array joint-control-channel)
(-> arg0
channel
(/ (&- (the-as pointer (-> arg1 root-channel)) (the-as uint (the-as pointer (-> arg1 channel)))) 48)
)
)
)
;; copy channels
(mem-copy!
@@ -644,6 +643,7 @@
arg0
)
;; 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
(sv-16 int)
@@ -653,7 +653,7 @@
(sv-48 joint-control-channel)
(sv-52 object)
(sv-56 int)
(sv-64 art-joint-anim)
(sv-64 joint)
(sv-80 string)
)
(set! sv-16 (+ (length (-> arg2 name)) 1))
@@ -685,10 +685,10 @@
)
)
)
(set! sv-64 (the-as art-joint-anim (lookup-art arg1 *temp-string* art-joint-anim)))
(set! sv-64 (lookup-art arg1 *temp-string* art-joint-anim))
(cond
(sv-64
(set! (-> sv-48 frame-group) sv-64)
(set! (-> sv-48 frame-group) (the-as art-joint-anim sv-64))
)
(else
(set! (-> sv-48 frame-group) (the-as art-joint-anim (-> arg1 data sv-40)))
@@ -884,7 +884,7 @@
(v0-0 (the-as object (-> arg0 data arg2 data)))
)
(cond
((zero? (logand (-> arg0 fixed hdr matrix-bits) 1))
((not (logtest? (-> arg0 fixed hdr matrix-bits) 1))
(set! v1-1 (cond
((zero? arg1)
(return (the-as matrix v1-1))
@@ -903,7 +903,7 @@
(set! v0-0 (-> (the-as (inline-array vector) v0-0) 4))
)
)
(if (zero? (logand (-> arg0 fixed hdr matrix-bits) 2))
(if (not (logtest? (-> arg0 fixed hdr matrix-bits) 2))
(return (the-as matrix v1-1))
)
(the-as matrix v0-0)
@@ -960,7 +960,7 @@
)
(else
(let ((a2-3 (matrix-from-control-channel!
(the-as matrix (+ 16 (the-as int (scratchpad-object terrain-context))))
(the-as matrix (-> (scratchpad-object terrain-context) work))
arg2
(the-as joint-control-channel arg1)
)
@@ -1029,7 +1029,7 @@
(the-as matrix (-> arg0 data))
)
(defmethod reset-and-assign-geo! cspace ((this cspace) (arg0 basic))
(defmethod reset-and-assign-geo! ((this cspace) (arg0 basic))
(set! (-> this parent) #f)
(set! (-> this joint) #f)
(set! (-> this geo) arg0)
@@ -1103,7 +1103,7 @@
(defun cspace<-matrix-no-push-joint! ((arg0 cspace) (arg1 joint-control))
(let ((v1-2 (matrix-from-control!
(the-as matrix-stack (+ 80 (the-as int (scratchpad-object terrain-context))))
(-> (scratchpad-object terrain-context) work foreground joint-work joint-stack)
(-> arg0 joint)
arg1
'no-push
@@ -1461,7 +1461,3 @@
(calc-animation-from-spr arg0 arg1)
0
)
+36 -49
View File
@@ -20,50 +20,41 @@
;; 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)
(number int32)
(parent joint)
(bind-pose matrix :inline)
)
:method-count-assert 9
:size-assert #x50
:flag-assert #x900000050
)
;; 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)
(parent-matrix uint32)
(dummy uint32)
(frame uint32)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; 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)
(position vector :inline :overlay-at (-> transform vector 3))
(scale vector :inline)
(cache bone-cache :inline)
)
:method-count-assert 9
:size-assert #x60
:flag-assert #x900000060
)
;; Like a real skeleton, this is a collection of bones for a single character.
(deftype skeleton (inline-array-class)
((bones bone :inline :dynamic))
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
((bones bone :inline :dynamic)
)
)
(set! (-> skeleton heap-base) 96)
(set! (-> skeleton heap-base) (the-as uint 96))
;; The "cspace" seems to be a system for linking bones and joints.
;; The tree structure matches the tree of joints.
@@ -78,35 +69,31 @@
;; 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)
(joint joint)
(joint-num int16)
(geo basic)
(bone bone)
(param0 function)
(param1 basic)
(param2 basic)
)
:method-count-assert 10
:size-assert #x20
:flag-assert #xa00000020
(:methods
(new (symbol type basic) _type_ 0)
(reset-and-assign-geo! (_type_ basic) _type_ 9)
(new (symbol type basic) _type_)
(reset-and-assign-geo! (_type_ basic) _type_)
)
)
;; All the cspaces for a character.
(deftype cspace-array (inline-array-class)
((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 ((this cspace))
(deftype cspace-array (inline-array-class)
((data cspace :inline :dynamic)
)
)
(set! (-> cspace-array heap-base) (the-as uint 32))
(defmethod print ((this cspace))
(format
#t
"#<cspace ~S @ #x~X>"
+47 -80
View File
@@ -13,16 +13,13 @@
(define *camera-layout-blink* #f)
(deftype cam-layout-bank (basic)
((spline-t float :offset-assert 4)
(spline-step float :offset-assert 8)
(intro-t float :offset-assert 12)
(intro-step float :offset-assert 16)
(debug-t float :offset-assert 20)
(debug-step float :offset-assert 24)
((spline-t float)
(spline-step float)
(intro-t float)
(intro-step float)
(debug-t float)
(debug-step float)
)
:method-count-assert 9
:size-assert #x1c
:flag-assert #x90000001c
)
@@ -40,72 +37,54 @@
(deftype clm-basic (basic)
()
:method-count-assert 9
:size-assert #x4
:flag-assert #x900000004
)
(deftype clm-item-action (structure)
((button uint64 :offset-assert 0)
(options uint64 :offset-assert 8)
(func symbol :offset-assert 16)
(parm0 int32 :offset 20)
(parm0-basic basic :offset 20)
(parm1-basic basic :offset 24)
(parm1 symbol :offset 24)
((button uint64)
(options uint64)
(func symbol)
(parm0 int32 :offset 20)
(parm0-basic basic :overlay-at parm0)
(parm1-basic basic :offset 24)
(parm1 symbol :overlay-at parm1-basic)
)
:method-count-assert 9
:size-assert #x1c
:flag-assert #x90000001c
)
(deftype clm-item (clm-basic)
((description string :offset-assert 4)
(button-symbol symbol :offset-assert 8)
(action clm-item-action :inline :offset-assert 16)
((description string)
(button-symbol symbol)
(action clm-item-action :inline)
)
:method-count-assert 9
:size-assert #x2c
:flag-assert #x90000002c
)
(deftype clm-list-item (basic)
((description string :offset-assert 4)
(track-val symbol :offset-assert 8)
(val-func symbol :offset-assert 12)
(val-parm0 int32 :offset 16)
(val-parm0-basic basic :offset 16)
(val-parm1-basic basic :offset 20)
(val-parm1 symbol :offset 20)
(actions (array clm-item-action) :offset-assert 24)
((description string)
(track-val symbol)
(val-func symbol)
(val-parm0 int32 :offset 16)
(val-parm0-basic basic :overlay-at val-parm0)
(val-parm1-basic basic :offset 20)
(val-parm1 symbol :overlay-at val-parm1-basic)
(actions (array clm-item-action))
)
:method-count-assert 9
:size-assert #x1c
:flag-assert #x90000001c
)
(deftype clm-list (clm-basic)
((tracker symbol :offset-assert 4)
(cur-list-item int32 :offset-assert 8)
(items (array clm-list-item) :offset-assert 12)
((tracker symbol)
(cur-list-item int32)
(items (array clm-list-item))
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
(deftype clm (basic)
((title string :offset-assert 4)
(items (array clm-basic) :offset-assert 8)
((title string)
(items (array clm-basic))
)
:method-count-assert 9
:size-assert #xc
:flag-assert #x90000000c
)
@@ -118,11 +97,8 @@
(define *volume-normal* (new 'debug 'vector-array 600))
(deftype volume-descriptor-array (inline-array-class)
((data plane-volume :inline :dynamic :offset 16)
((data plane-volume :inline :dynamic :offset 16)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
@@ -133,19 +109,16 @@
(define *volume-descriptor* (the-as vol-control (new 'debug 'volume-descriptor-array 100)))
(deftype cam-layout (process)
((cam-entity entity-camera :offset-assert 112)
(num-entities int32 :offset-assert 116)
(cur-entity int32 :offset-assert 120)
(num-volumes int32 :offset-assert 124)
(cur-volume int32 :offset-assert 128)
(first-pvol int32 :offset-assert 132)
(first-cutoutvol int32 :offset-assert 136)
(res-key float :offset-assert 140)
((cam-entity entity-camera)
(num-entities int32)
(cur-entity int32)
(num-volumes int32)
(cur-volume int32)
(first-pvol int32)
(first-cutoutvol int32)
(res-key float)
)
:heap-base #x200
:method-count-assert 14
:size-assert #x90
:flag-assert #xe02000090
(:states
cam-layout-active
)
@@ -437,16 +410,13 @@
)
(deftype interp-test-info (structure)
((from vector :inline :offset-assert 0)
(to vector :inline :offset-assert 16)
(origin vector :inline :offset-assert 32)
(color vector4w :offset-assert 48)
(axis vector :offset-assert 52)
(disp string :offset-assert 56)
((from vector :inline)
(to vector :inline)
(origin vector :inline)
(color vector4w)
(axis vector)
(disp string)
)
:method-count-assert 9
:size-assert #x3c
:flag-assert #x90000003c
)
@@ -2206,13 +2176,10 @@
)
(deftype clmf-cam-flag-toggle-info (structure)
((key float :offset-assert 0)
(force-on int32 :offset-assert 4)
(force-off int32 :offset-assert 8)
((key float)
(force-on int32)
(force-off int32)
)
:method-count-assert 9
:size-assert #xc
:flag-assert #x90000000c
)
+9 -16
View File
@@ -13,18 +13,15 @@
;; DECOMP BEGINS
(deftype camera-master-bank (basic)
((onscreen-head-height meters :offset-assert 4)
(onscreen-foot-height meters :offset-assert 8)
(target-height meters :offset-assert 12)
(up-move-to-pitch-ratio-in-air float :offset-assert 16)
(down-move-to-pitch-ratio-in-air float :offset-assert 20)
(up-move-to-pitch-on-ground float :offset-assert 24)
(down-move-to-pitch-on-ground float :offset-assert 28)
(pitch-off-blend float :offset-assert 32)
((onscreen-head-height meters)
(onscreen-foot-height meters)
(target-height meters)
(up-move-to-pitch-ratio-in-air float)
(down-move-to-pitch-ratio-in-air float)
(up-move-to-pitch-on-ground float)
(down-move-to-pitch-on-ground float)
(pitch-off-blend float)
)
:method-count-assert 9
:size-assert #x24
:flag-assert #x900000024
)
@@ -1598,12 +1595,8 @@
)
(deftype list-keeper (process)
((dummy float :offset-assert 112)
((dummy float)
)
:heap-base #x10
:method-count-assert 14
:size-assert #x74
:flag-assert #xe00100074
)
+17 -32
View File
@@ -8,12 +8,9 @@
;; DECOMP BEGINS
(deftype cam-point-watch-bank (basic)
((speed float :offset-assert 4)
(rot-speed degrees :offset-assert 8)
((speed float)
(rot-speed degrees)
)
:method-count-assert 9
:size-assert #xc
:flag-assert #x90000000c
)
@@ -87,12 +84,9 @@
)
(deftype cam-free-bank (basic)
((speed float :offset-assert 4)
(rot-speed degrees :offset-assert 8)
((speed float)
(rot-speed degrees)
)
:method-count-assert 9
:size-assert #xc
:flag-assert #x90000000c
)
@@ -339,14 +333,11 @@
)
(deftype camera-free-floating-move-info (structure)
((rv vector :inline :offset-assert 0)
(tv vector :inline :offset-assert 16)
(up vector :inline :offset-assert 32)
(tm matrix :inline :offset-assert 48)
((rv vector :inline)
(tv vector :inline)
(up vector :inline)
(tm matrix :inline)
)
:method-count-assert 9
:size-assert #x70
:flag-assert #x900000070
)
@@ -424,27 +415,21 @@
)
(deftype camera-orbit-info (structure)
((radius float :offset-assert 0)
(rot float :offset-assert 4)
(target-off vector :inline :offset-assert 16)
(orbit-off vector :inline :offset-assert 32)
(radius-lerp float :offset-assert 48)
((radius float)
(rot float)
(target-off vector :inline)
(orbit-off vector :inline)
(radius-lerp float)
)
:method-count-assert 9
:size-assert #x34
:flag-assert #x900000034
)
(deftype CAM_ORBIT-bank (basic)
((RADIUS_MAX float :offset-assert 4)
(RADIUS_MIN float :offset-assert 8)
(TARGET_OFF_ADJUST float :offset-assert 12)
(ORBIT_OFF_ADJUST float :offset-assert 16)
((RADIUS_MAX float)
(RADIUS_MIN float)
(TARGET_OFF_ADJUST float)
(ORBIT_OFF_ADJUST float)
)
:method-count-assert 9
:size-assert #x14
:flag-assert #x900000014
)
+33 -57
View File
@@ -376,14 +376,11 @@
)
(deftype cam-eye-bank (basic)
((rot-speed float :offset-assert 4)
(max-degrees float :offset-assert 8)
(max-fov float :offset-assert 12)
(min-fov float :offset-assert 16)
((rot-speed float)
(max-degrees float)
(max-fov float)
(min-fov float)
)
:method-count-assert 9
:size-assert #x14
:flag-assert #x900000014
)
@@ -547,12 +544,9 @@
)
(deftype cam-billy-bank (basic)
((rot-speed float :offset-assert 4)
(tilt-degrees float :offset-assert 8)
((rot-speed float)
(tilt-degrees float)
)
:method-count-assert 9
:size-assert #xc
:flag-assert #x90000000c
)
@@ -1168,12 +1162,9 @@
)
(deftype cam-string-bank (basic)
((los-coll-rad meters :offset-assert 4)
(los-coll-rad2 meters :offset-assert 8)
((los-coll-rad meters)
(los-coll-rad2 meters)
)
:method-count-assert 9
:size-assert #xc
:flag-assert #x90000000c
)
@@ -1268,30 +1259,24 @@
)
(deftype los-dist (structure)
((par-dist float :offset-assert 0)
(lat-dist float :offset-assert 4)
(vert-dist float :offset-assert 8)
((par-dist float)
(lat-dist float)
(vert-dist float)
)
:method-count-assert 9
:size-assert #xc
:flag-assert #x90000000c
)
(deftype collide-los-dist-info (structure)
((min-par float :offset-assert 0)
(max-par float :offset-assert 4)
(min-lat float :offset-assert 8)
(max-lat float :offset-assert 12)
(min-vp float :offset-assert 16)
(max-vp float :offset-assert 20)
(min-vn float :offset-assert 24)
(max-vn float :offset-assert 28)
(count int32 :offset-assert 32)
((min-par float)
(max-par float)
(min-lat float)
(max-lat float)
(min-vp float)
(max-vp float)
(min-vn float)
(max-vn float)
(count int32)
)
:method-count-assert 9
:size-assert #x24
:flag-assert #x900000024
)
@@ -1395,15 +1380,12 @@
)
(deftype collide-los-result (structure)
((lateral vector :inline :offset-assert 0)
(cw collide-los-dist-info :inline :offset-assert 16)
(ccw collide-los-dist-info :inline :offset-assert 64)
(straddle collide-los-dist-info :inline :offset-assert 112)
(lateral-valid symbol :offset-assert 148)
((lateral vector :inline)
(cw collide-los-dist-info :inline)
(ccw collide-los-dist-info :inline)
(straddle collide-los-dist-info :inline)
(lateral-valid symbol)
)
:method-count-assert 9
:size-assert #x98
:flag-assert #x900000098
)
@@ -2906,14 +2888,11 @@
)
(deftype cam-stick-bank (basic)
((max-z meters :offset-assert 4)
(min-z meters :offset-assert 8)
(max-y meters :offset-assert 12)
(min-y meters :offset-assert 16)
((max-z meters)
(min-z meters)
(max-y meters)
(min-y meters)
)
:method-count-assert 9
:size-assert #x14
:flag-assert #x900000014
)
@@ -3132,14 +3111,11 @@
)
(deftype cam-bike-bank (basic)
((max-z meters :offset-assert 4)
(min-z meters :offset-assert 8)
(max-y meters :offset-assert 12)
(min-y meters :offset-assert 16)
((max-z meters)
(min-z meters)
(max-y meters)
(min-y meters)
)
:method-count-assert 9
:size-assert #x14
:flag-assert #x900000014
)
+200 -236
View File
@@ -64,20 +64,17 @@
;; DECOMP BEGINS
(deftype camera-bank (basic)
((collide-move-rad float :offset-assert 4)
(joypad uint32 :offset-assert 8)
(min-detectable-velocity float :offset-assert 12)
(attack-timeout time-frame :offset-assert 16)
(default-string-max-y meters :offset-assert 24)
(default-string-min-y meters :offset-assert 28)
(default-string-max-z meters :offset-assert 32)
(default-string-min-z meters :offset-assert 36)
(default-string-push-z meters :offset-assert 40)
(default-tilt-adjust degrees :offset-assert 44)
((collide-move-rad float)
(joypad uint32)
(min-detectable-velocity float)
(attack-timeout time-frame)
(default-string-max-y meters)
(default-string-min-y meters)
(default-string-max-z meters)
(default-string-min-z meters)
(default-string-push-z meters)
(default-tilt-adjust degrees)
)
:method-count-assert 9
:size-assert #x30
:flag-assert #x900000030
)
@@ -95,103 +92,88 @@
)
(deftype cam-index (structure)
((flags cam-index-options :offset-assert 0)
(vec vector 2 :inline :offset 16)
((flags cam-index-options)
(vec vector 2 :inline :offset 16)
)
:method-count-assert 11
:size-assert #x30
:flag-assert #xb00000030
(:methods
(cam-index-method-9 (_type_ symbol entity vector curve) symbol 9)
(cam-index-method-10 (_type_ vector) float 10)
(cam-index-method-9 (_type_ symbol entity vector curve) symbol)
(cam-index-method-10 (_type_ vector) float)
)
)
(deftype tracking-point (structure)
((position vector :inline :offset-assert 0)
(direction vector :inline :offset-assert 16)
(tp-length float :offset-assert 32)
(next int32 :offset-assert 36)
(incarnation int32 :offset-assert 40)
((position vector :inline)
(direction vector :inline)
(tp-length float)
(next int32)
(incarnation int32)
)
:method-count-assert 9
:size-assert #x2c
:flag-assert #x90000002c
)
(deftype tracking-spline-sampler (structure)
((cur-pt int32 :offset-assert 0)
(partial-pt float :offset-assert 4)
((cur-pt int32)
(partial-pt float)
)
:method-count-assert 9
:size-assert #x8
:flag-assert #x900000008
)
(deftype tracking-spline (structure)
((point tracking-point 32 :inline :offset-assert 0)
(summed-len float :offset-assert 1536)
(free-point int32 :offset-assert 1540)
(used-point int32 :offset-assert 1544)
(partial-point float :offset-assert 1548)
(end-point int32 :offset-assert 1552)
(next-to-last-point int32 :offset-assert 1556)
(max-move float :offset-assert 1560)
(sample-len float :offset-assert 1564)
(used-count int32 :offset-assert 1568)
(old-position vector :inline :offset-assert 1584)
(debug-old-position vector :inline :offset-assert 1600)
(debug-out-position vector :inline :offset-assert 1616)
(debug-last-point int32 :offset-assert 1632)
((point tracking-point 32 :inline)
(summed-len float)
(free-point int32)
(used-point int32)
(partial-point float)
(end-point int32)
(next-to-last-point int32)
(max-move float)
(sample-len float)
(used-count int32)
(old-position vector :inline)
(debug-old-position vector :inline)
(debug-out-position vector :inline)
(debug-last-point int32)
)
:method-count-assert 24
:size-assert #x664
:flag-assert #x1800000664
(:methods
(tracking-spline-method-9 (_type_) none 9)
(tracking-spline-method-10 (_type_ vector) none 10)
(print-nth-point (_type_ int) none 11)
(tracking-spline-method-12 (_type_) none 12)
(tracking-spline-method-13 (_type_ int) none 13)
(tracking-spline-method-14 (_type_ tracking-spline-sampler) none 14)
(tracking-spline-method-15 (_type_) none 15)
(tracking-spline-method-16 (_type_ float) none 16)
(tracking-spline-method-17 (_type_ vector float float symbol) int 17)
(tracking-spline-method-18 (_type_ float vector tracking-spline-sampler) vector 18)
(tracking-spline-method-19 (_type_ float vector tracking-spline-sampler) vector 19)
(tracking-spline-method-20 (_type_ vector int) none 20)
(tracking-spline-method-21 (_type_ vector float float) vector 21)
(tracking-spline-method-22 (_type_ float) none 22)
(tracking-spline-method-23 (_type_) none 23)
(tracking-spline-method-9 (_type_) none)
(tracking-spline-method-10 (_type_ vector) none)
(print-nth-point (_type_ int) none)
(tracking-spline-method-12 (_type_) none)
(tracking-spline-method-13 (_type_ int) none)
(tracking-spline-method-14 (_type_ tracking-spline-sampler) none)
(tracking-spline-method-15 (_type_) none)
(tracking-spline-method-16 (_type_ float) none)
(tracking-spline-method-17 (_type_ vector float float symbol) int)
(tracking-spline-method-18 (_type_ float vector tracking-spline-sampler) vector)
(tracking-spline-method-19 (_type_ float vector tracking-spline-sampler) vector)
(tracking-spline-method-20 (_type_ vector int) none)
(tracking-spline-method-21 (_type_ vector float float) vector)
(tracking-spline-method-22 (_type_ float) none)
(tracking-spline-method-23 (_type_) none)
)
)
(deftype cam-float-seeker (structure)
((target float :offset-assert 0)
(value float :offset-assert 4)
(vel float :offset-assert 8)
(accel float :offset-assert 12)
(max-vel float :offset-assert 16)
(max-partial float :offset-assert 20)
((target float)
(value float)
(vel float)
(accel float)
(max-vel float)
(max-partial float)
)
:pack-me
:method-count-assert 13
:size-assert #x18
:flag-assert #xd00000018
(:methods
(init-cam-float-seeker (_type_ float float float float) none 9)
(copy-cam-float-seeker (_type_ _type_) none 10)
(update! (_type_ float) none 11)
(jump-to-target! (_type_ float) float 12)
(init-cam-float-seeker (_type_ float float float float) none)
(copy-cam-float-seeker (_type_ _type_) none)
(update! (_type_ float) none)
(jump-to-target! (_type_ float) float)
)
)
(defmethod init-cam-float-seeker cam-float-seeker ((this cam-float-seeker) (arg0 float) (arg1 float) (arg2 float) (arg3 float))
(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)
@@ -202,7 +184,7 @@
(none)
)
(defmethod copy-cam-float-seeker cam-float-seeker ((this cam-float-seeker) (arg0 cam-float-seeker))
(defmethod copy-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))
@@ -213,7 +195,7 @@
(none)
)
(defmethod update! cam-float-seeker ((this cam-float-seeker) (offset float))
(defmethod update! ((this cam-float-seeker) (offset float))
0.0
0.0
(let* ((pos-error (- (+ (-> this target) offset) (-> this value)))
@@ -237,30 +219,27 @@
(none)
)
(defmethod jump-to-target! cam-float-seeker ((this cam-float-seeker) (arg0 float))
(defmethod jump-to-target! ((this cam-float-seeker) (arg0 float))
(set! (-> this value) (+ (-> this target) arg0))
(set! (-> this vel) 0.0)
)
(deftype cam-vector-seeker (structure)
((target vector :inline :offset-assert 0)
(value vector :inline :offset-assert 16)
(vel vector :inline :offset-assert 32)
(accel float :offset-assert 48)
(max-vel float :offset-assert 52)
(max-partial float :offset-assert 56)
((target vector :inline)
(value vector :inline)
(vel vector :inline)
(accel float)
(max-vel float)
(max-partial float)
)
:method-count-assert 11
:size-assert #x3c
:flag-assert #xb0000003c
(:methods
(init! (_type_ vector float float float) none 9)
(update! (_type_ vector) none 10)
(init! (_type_ vector float float float) none)
(update! (_type_ vector) none)
)
)
(defmethod init! cam-vector-seeker ((this cam-vector-seeker) (arg0 vector) (arg1 float) (arg2 float) (arg3 float))
(defmethod init! ((this cam-vector-seeker) (arg0 vector) (arg1 float) (arg2 float) (arg3 float))
(cond
(arg0
(set! (-> this target quad) (-> arg0 quad))
@@ -279,7 +258,7 @@
(none)
)
(defmethod update! cam-vector-seeker ((this cam-vector-seeker) (arg0 vector))
(defmethod update! ((this cam-vector-seeker) (arg0 vector))
(let ((gp-0 (new 'stack-no-clear 'vector)))
0.0
(cond
@@ -310,41 +289,34 @@
)
(deftype cam-rotation-tracker (structure)
((inv-mat matrix :inline :offset-assert 0)
(no-follow basic :offset-assert 64)
(follow-pt vector :inline :offset-assert 80)
(follow-off vector :inline :offset-assert 96)
(follow-blend float :offset-assert 112)
(tilt-adjust cam-float-seeker :inline :offset-assert 116)
(use-point-of-interest basic :offset-assert 140)
(point-of-interest vector :inline :offset-assert 144)
(point-of-interest-blend cam-float-seeker :inline :offset-assert 160)
(underwater-blend cam-float-seeker :inline :offset-assert 184)
((inv-mat matrix :inline)
(no-follow basic)
(follow-pt vector :inline)
(follow-off vector :inline)
(follow-blend float)
(tilt-adjust cam-float-seeker :inline)
(use-point-of-interest basic)
(point-of-interest vector :inline)
(point-of-interest-blend cam-float-seeker :inline)
(underwater-blend cam-float-seeker :inline)
)
:method-count-assert 9
:size-assert #xd0
:flag-assert #x9000000d0
)
(deftype camera-combiner (process)
((trans vector :inline :offset-assert 112)
(inv-camera-rot matrix :inline :offset-assert 128)
(fov float :offset-assert 192)
(interp-val float :offset-assert 196)
(interp-step float :offset-assert 200)
(dist-from-src float :offset-assert 204)
(dist-from-dest float :offset-assert 208)
(flip-control-axis vector :inline :offset-assert 224)
(velocity vector :inline :offset-assert 240)
(tracking-status uint64 :offset-assert 256)
(tracking-options int32 :offset-assert 264)
(tracking cam-rotation-tracker :inline :offset-assert 272)
((trans vector :inline)
(inv-camera-rot matrix :inline)
(fov float)
(interp-val float)
(interp-step float)
(dist-from-src float)
(dist-from-dest float)
(flip-control-axis vector :inline)
(velocity vector :inline)
(tracking-status uint64)
(tracking-options int32)
(tracking cam-rotation-tracker :inline)
)
:heap-base #x170
:method-count-assert 14
:size-assert #x1e0
:flag-assert #xe017001e0
(:states
cam-combiner-active
)
@@ -352,62 +324,58 @@
(deftype camera-slave (process)
((trans vector :inline :offset-assert 112)
(fov float :offset-assert 128)
(fov0 float :offset-assert 132)
(fov1 float :offset-assert 136)
(fov-index cam-index :inline :offset-assert 144)
(tracking cam-rotation-tracker :inline :offset-assert 192)
(view-off-param float :offset-assert 400)
(unknown-symbol symbol :offset 412)
(view-off vector :inline :offset-assert 416)
(min-z-override float :offset-assert 432)
(view-flat vector :inline :offset-assert 448)
(string-vel-dir uint32 :offset-assert 464)
(string-trans vector :inline :offset-assert 480)
(position-spline tracking-spline :inline :offset-assert 496)
(pivot-pt vector :inline :offset-assert 2144)
(pivot-rad float :offset-assert 2160)
(circular-follow vector :inline :offset-assert 2176)
(max-angle-offset float :offset-assert 2192)
(max-angle-curr float :offset-assert 2196)
(options uint32 :offset-assert 2200)
(cam-entity entity :offset-assert 2204)
(velocity vector :inline :offset-assert 2208)
(desired-pos vector :inline :offset-assert 2224)
(time-dist-too-far uint32 :offset-assert 2240)
(los-state slave-los-state :offset-assert 2244)
(good-point vector :inline :offset-assert 2256)
(los-tgt-spline-pt int32 :offset-assert 2272)
(los-tgt-spline-pt-incarnation int32 :offset-assert 2276)
(los-last-pos vector :inline :offset-assert 2288)
(intro-curve curve :inline :offset-assert 2304)
(intro-offset vector :inline :offset-assert 2336)
(intro-t float :offset-assert 2352)
(intro-t-step float :offset-assert 2356)
(outro-exit-value float :offset-assert 2360)
(spline-exists basic :offset-assert 2364)
(spline-curve curve :inline :offset-assert 2368)
(spline-offset vector :inline :offset-assert 2400)
(index cam-index :inline :offset-assert 2416)
(saved-pt vector :inline :offset-assert 2464)
(spline-tt float :offset-assert 2480)
(spline-follow-dist float :offset-assert 2484)
(change-event-from (pointer process-drawable) :offset-assert 2488)
(enter-has-run symbol :offset-assert 2492)
(blend-from-type uint64 :offset-assert 2496)
(blend-to-type uint64 :offset-assert 2504)
(have-phony-joystick basic :offset-assert 2512)
(phony-joystick-x float :offset-assert 2516)
(phony-joystick-y float :offset-assert 2520)
(string-min-val vector :inline :offset-assert 2528)
(string-max-val vector :inline :offset-assert 2544)
(string-val-locked basic :offset-assert 2560)
((trans vector :inline)
(fov float)
(fov0 float)
(fov1 float)
(fov-index cam-index :inline)
(tracking cam-rotation-tracker :inline)
(view-off-param float)
(unknown-symbol symbol :offset 412)
(view-off vector :inline)
(min-z-override float)
(view-flat vector :inline)
(string-vel-dir uint32)
(string-trans vector :inline)
(position-spline tracking-spline :inline)
(pivot-pt vector :inline)
(pivot-rad float)
(circular-follow vector :inline)
(max-angle-offset float)
(max-angle-curr float)
(options uint32)
(cam-entity entity)
(velocity vector :inline)
(desired-pos vector :inline)
(time-dist-too-far uint32)
(los-state slave-los-state)
(good-point vector :inline)
(los-tgt-spline-pt int32)
(los-tgt-spline-pt-incarnation int32)
(los-last-pos vector :inline)
(intro-curve curve :inline)
(intro-offset vector :inline)
(intro-t float)
(intro-t-step float)
(outro-exit-value float)
(spline-exists basic)
(spline-curve curve :inline)
(spline-offset vector :inline)
(index cam-index :inline)
(saved-pt vector :inline)
(spline-tt float)
(spline-follow-dist float)
(change-event-from (pointer process-drawable))
(enter-has-run symbol)
(blend-from-type uint64)
(blend-to-type uint64)
(have-phony-joystick basic)
(phony-joystick-x float)
(phony-joystick-y float)
(string-min-val vector :inline)
(string-max-val vector :inline)
(string-val-locked basic)
)
:heap-base #x9a0
:method-count-assert 14
:size-assert #xa04
:flag-assert #xe09a00a04
(:states
*camera-base-mode*
cam-bike
@@ -440,64 +408,60 @@
(deftype camera-master (process)
((master-options uint32 :offset-assert 112)
(num-slaves int32 :offset-assert 116)
(slave (pointer camera-slave) 2 :offset-assert 120)
(slave-options uint32 :offset-assert 128)
(view-off-param-save float :offset-assert 132)
(changer uint32 :offset-assert 136)
(cam-entity entity :offset-assert 140)
(stringMinLength float :offset-assert 144)
(stringMaxLength float :offset-assert 148)
(stringMinHeight float :offset-assert 152)
(stringMaxHeight float :offset-assert 156)
(string-min cam-vector-seeker :inline :offset-assert 160)
(string-max cam-vector-seeker :inline :offset-assert 224)
(string-push-z float :offset-assert 284)
(stringCliffHeight float :offset-assert 288)
(no-intro uint32 :offset-assert 292)
(force-blend uint32 :offset-assert 296)
(force-blend-time uint32 :offset-assert 300)
(local-down vector :inline :offset-assert 304)
(drawable-target handle :offset-assert 320)
(which-bone int32 :offset-assert 328)
(pov-handle handle :offset-assert 336)
(pov-bone int32 :offset-assert 344)
(being-attacked symbol :offset-assert 348)
(attack-start time-frame :offset-assert 352)
(on-ground symbol :offset-assert 360)
(under-water int32 :offset-assert 364)
(on-pole symbol :offset-assert 368)
(tgt-rot-mat matrix :inline :offset-assert 384)
(tgt-face-mat matrix :inline :offset-assert 448)
(tpos-old vector :inline :offset-assert 512)
(tpos-curr vector :inline :offset-assert 528)
(target-height float :offset-assert 544)
(tpos-old-adj vector :inline :offset-assert 560)
(tpos-curr-adj vector :inline :offset-assert 576)
(tpos-tgt vector :inline :offset-assert 592)
(upspeed float :offset-assert 608)
(pitch-off vector :inline :offset-assert 624)
(foot-offset float :offset-assert 640)
(head-offset float :offset-assert 644)
(target-spline tracking-spline :inline :offset-assert 656)
(ease-from vector :inline :offset-assert 2304)
(ease-t float :offset-assert 2320)
(ease-step float :offset-assert 2324)
(ease-to vector :inline :offset-assert 2336)
(outro-curve curve :inline :offset-assert 2352)
(outro-t float :offset-assert 2372)
(outro-t-step float :offset-assert 2376)
(outro-exit-value float :offset-assert 2380)
(water-drip-time time-frame :offset-assert 2384)
(water-drip sparticle-launch-control :offset-assert 2392)
(water-drip-mult float :offset-assert 2396)
(water-drip-speed float :offset-assert 2400)
((master-options uint32)
(num-slaves int32)
(slave (pointer camera-slave) 2)
(slave-options uint32)
(view-off-param-save float)
(changer uint32)
(cam-entity entity)
(stringMinLength float)
(stringMaxLength float)
(stringMinHeight float)
(stringMaxHeight float)
(string-min cam-vector-seeker :inline)
(string-max cam-vector-seeker :inline)
(string-push-z float)
(stringCliffHeight float)
(no-intro uint32)
(force-blend uint32)
(force-blend-time uint32)
(local-down vector :inline)
(drawable-target handle)
(which-bone int32)
(pov-handle handle)
(pov-bone int32)
(being-attacked symbol)
(attack-start time-frame)
(on-ground symbol)
(under-water int32)
(on-pole symbol)
(tgt-rot-mat matrix :inline)
(tgt-face-mat matrix :inline)
(tpos-old vector :inline)
(tpos-curr vector :inline)
(target-height float)
(tpos-old-adj vector :inline)
(tpos-curr-adj vector :inline)
(tpos-tgt vector :inline)
(upspeed float)
(pitch-off vector :inline)
(foot-offset float)
(head-offset float)
(target-spline tracking-spline :inline)
(ease-from vector :inline)
(ease-t float)
(ease-step float)
(ease-to vector :inline)
(outro-curve curve :inline)
(outro-t float)
(outro-t-step float)
(outro-exit-value float)
(water-drip-time time-frame)
(water-drip sparticle-launch-control)
(water-drip-mult float)
(water-drip-speed float)
)
:heap-base #x900
:method-count-assert 14
:size-assert #x964
:flag-assert #xe09000964
(:states
cam-master-active
list-keeper-active
+14 -14
View File
@@ -343,7 +343,7 @@
)
)
(defmethod cam-index-method-9 cam-index ((this cam-index) (arg0 symbol) (arg1 entity) (arg2 vector) (arg3 curve))
(defmethod cam-index-method-9 ((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! (-> this flags) (the-as cam-index-options (cam-slave-get-flags arg1 (string->symbol *res-key-string*))))
@@ -419,7 +419,7 @@
#t
)
(defmethod cam-index-method-10 cam-index ((this cam-index) (arg0 vector))
(defmethod cam-index-method-10 ((this cam-index) (arg0 vector))
(let ((s5-0 (new-stack-vector0)))
0.0
(vector-! s5-0 arg0 (the-as vector (-> this vec)))
@@ -438,7 +438,7 @@
)
)
(defmethod tracking-spline-method-10 tracking-spline ((this tracking-spline) (arg0 vector))
(defmethod tracking-spline-method-10 ((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)
@@ -462,7 +462,7 @@
(none)
)
(defmethod tracking-spline-method-13 tracking-spline ((this tracking-spline) (arg0 int))
(defmethod tracking-spline-method-13 ((this tracking-spline) (arg0 int))
(let ((v1-3 (-> this point arg0 next)))
(cond
((= v1-3 -134250495)
@@ -495,7 +495,7 @@
(none)
)
(defmethod tracking-spline-method-14 tracking-spline ((this tracking-spline) (arg0 tracking-spline-sampler))
(defmethod tracking-spline-method-14 ((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)
@@ -534,7 +534,7 @@
(none)
)
(defmethod tracking-spline-method-15 tracking-spline ((this tracking-spline))
(defmethod tracking-spline-method-15 ((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) (-> this used-point))
@@ -580,7 +580,7 @@
(none)
)
(defmethod tracking-spline-method-16 tracking-spline ((this tracking-spline) (arg0 float))
(defmethod tracking-spline-method-16 ((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) (-> this used-point))
@@ -618,7 +618,7 @@
(none)
)
(defmethod tracking-spline-method-17 tracking-spline ((this tracking-spline) (arg0 vector) (arg1 float) (arg2 float) (arg3 symbol))
(defmethod tracking-spline-method-17 ((this tracking-spline) (arg0 vector) (arg1 float) (arg2 float) (arg3 symbol))
(let ((s3-0 (-> this free-point))
(s2-0 (-> this end-point))
)
@@ -659,7 +659,7 @@
0
)
(defmethod tracking-spline-method-18 tracking-spline ((this tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler))
(defmethod tracking-spline-method-18 ((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))
@@ -701,13 +701,13 @@
(the-as vector #f)
)
(defmethod tracking-spline-method-19 tracking-spline ((this tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler))
(defmethod tracking-spline-method-19 ((this tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler))
(vector-reset! arg1)
(tracking-spline-method-18 this arg0 arg1 arg2)
arg1
)
(defmethod tracking-spline-method-20 tracking-spline ((this tracking-spline) (arg0 vector) (arg1 int))
(defmethod tracking-spline-method-20 ((this tracking-spline) (arg0 vector) (arg1 int))
(let ((s3-0 (new 'stack-no-clear 'vector)))
(vector-!
s3-0
@@ -795,7 +795,7 @@
(none)
)
(defmethod tracking-spline-method-21 tracking-spline ((this tracking-spline) (arg0 vector) (arg1 float) (arg2 float))
(defmethod tracking-spline-method-21 ((this tracking-spline) (arg0 vector) (arg1 float) (arg2 float))
(let ((v1-0 (-> this used-point))
(f0-0 (-> this partial-point))
)
@@ -843,7 +843,7 @@
arg0
)
(defmethod tracking-spline-method-22 tracking-spline ((this tracking-spline) (arg0 float))
(defmethod tracking-spline-method-22 ((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)))
@@ -858,7 +858,7 @@
(none)
)
(defmethod tracking-spline-method-9 tracking-spline ((this tracking-spline))
(defmethod tracking-spline-method-9 ((this tracking-spline))
(let ((v1-0 (-> this used-point))
(s4-0 0)
(s5-0 0)
+21 -23
View File
@@ -22,30 +22,28 @@
;; for example, the introduction to orbs in geyser, or the camera that shows you where the steps to fire canyon
;; are.
(deftype pov-camera (process-drawable)
((cspace-array cspace-array :offset 112)
(flags pov-camera-flag :offset-assert 176)
(debounce-start-time time-frame :offset-assert 184)
(notify-handle handle :offset-assert 192)
(anim-name string :offset-assert 200)
(command-list pair :offset-assert 204)
(mask-to-clear process-mask :offset-assert 208)
(music-volume-movie float :offset-assert 212)
(sfx-volume-movie float :offset-assert 216)
((cspace-array cspace-array :overlay-at root)
(flags pov-camera-flag)
(debounce-start-time time-frame)
(notify-handle handle)
(anim-name string)
(command-list pair)
(mask-to-clear process-mask)
(music-volume-movie float)
(sfx-volume-movie float)
)
:heap-base #x70
:method-count-assert 30
:size-assert #xdc
:flag-assert #x1e007000dc
(:state-methods
pov-camera-abort
pov-camera-done-playing
pov-camera-playing
pov-camera-start-playing
pov-camera-startup
)
(:methods
(pov-camera-abort () _type_ :state 20)
(pov-camera-done-playing () _type_ :state 21)
(pov-camera-playing () _type_ :state 22)
(pov-camera-start-playing () _type_ :state 23)
(pov-camera-startup () _type_ :state 24)
(check-for-abort (_type_) symbol 25)
(target-grabbed? (_type_) symbol 26)
(pre-startup-callback (_type_) none 27)
(target-released? () symbol 28)
(set-stack-size! (_type_) none 29)
(check-for-abort (_type_) symbol)
(target-grabbed? (_type_) symbol)
(pre-startup-callback (_type_) none)
(target-released? (_type_) symbol)
(set-stack-size! (_type_) none)
)
)
+6 -6
View File
@@ -7,7 +7,7 @@
;; DECOMP BEGINS
(defmethod check-for-abort pov-camera ((this pov-camera))
(defmethod check-for-abort ((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))
)
@@ -20,11 +20,11 @@
)
)
(defmethod target-grabbed? pov-camera ((this pov-camera))
(defmethod target-grabbed? ((this pov-camera))
(or (not *target*) (process-grab? *target*))
)
(defmethod target-released? pov-camera ()
(defmethod target-released? ((this pov-camera))
(or (not *target*) (process-release? *target*))
)
@@ -148,7 +148,7 @@
(defstate pov-camera-done-playing (pov-camera)
:virtual #t
:code (behavior ()
(while (begin self (not ((method-of-object self target-released?))))
(while (not (target-released? self))
(suspend)
)
(send-event (handle->process (-> self notify-handle)) 'notify 'die)
@@ -159,12 +159,12 @@
)
)
(defmethod pre-startup-callback pov-camera ((this pov-camera))
(defmethod pre-startup-callback ((this pov-camera))
0
(none)
)
(defmethod set-stack-size! pov-camera ((this pov-camera))
(defmethod set-stack-size! ((this pov-camera))
(none)
)
+81 -111
View File
@@ -16,56 +16,44 @@
;;;;;;;;;;;;;;;;;;;;;;;
(deftype collide-using-spheres-params (structure)
((spheres (inline-array sphere) :offset-assert 0)
(num-spheres uint32 :offset-assert 4)
(collide-with collide-kind :offset-assert 8)
(proc process-drawable :offset-assert 16)
(ignore-pat pat-surface :offset-assert 20)
(solid-only basic :offset-assert 24)
((spheres (inline-array sphere))
(num-spheres uint32)
(collide-with collide-kind)
(proc process-drawable)
(ignore-pat pat-surface)
(solid-only basic)
)
:method-count-assert 9
:size-assert #x1c
:flag-assert #x90000001c
)
;; primitive using sphere-sphere
(deftype collide-puss-sphere (structure)
((bsphere sphere :inline :offset-assert 0)
(bbox4w bounding-box4w :inline :offset-assert 16)
((bsphere sphere :inline)
(bbox4w bounding-box4w :inline)
)
:method-count-assert 9
:size-assert #x30
:flag-assert #x900000030
)
(deftype collide-puss-work (structure)
((closest-pt vector :inline :offset-assert 0)
(tri-normal vector :inline :offset-assert 16)
(tri-bbox4w bounding-box4w :inline :offset-assert 32)
(spheres-bbox4w bounding-box4w :inline :offset-assert 64)
(spheres collide-puss-sphere 64 :inline :offset-assert 96)
((closest-pt vector :inline)
(tri-normal vector :inline)
(tri-bbox4w bounding-box4w :inline)
(spheres-bbox4w bounding-box4w :inline)
(spheres collide-puss-sphere 64 :inline)
)
:method-count-assert 11
:size-assert #xc60
:flag-assert #xb00000c60
(:methods
(collide-puss-work-method-9 (_type_ object object) symbol 9)
(collide-puss-work-method-10 (_type_ object object) symbol 10)
(collide-puss-work-method-9 (_type_ object object) symbol)
(collide-puss-work-method-10 (_type_ object object) symbol)
)
)
;; primitive using y probe
(deftype collide-puyp-work (structure)
((best-u float :offset-assert 0)
(ignore-pat pat-surface :offset-assert 4)
(tri-out collide-tri-result :offset-assert 8)
(start-pos vector :inline :offset-assert 16)
(move-dist vector :inline :offset-assert 32)
((best-u float)
(ignore-pat pat-surface)
(tri-out collide-tri-result)
(start-pos vector :inline)
(move-dist vector :inline)
)
:method-count-assert 9
:size-assert #x30
:flag-assert #x900000030
)
;;;;;;;;;;;;;;;;;;;;;;;
@@ -75,116 +63,98 @@
;; The triangles stored in the cache.
;; This is a common return type of collision queries.
(deftype collide-cache-tri (structure)
((vertex vector 3 :inline :offset-assert 0) ;; actual locations
(extra-quad uint128 :offset 48)
(pat pat-surface :offset 48) ;; metadata about the surface of this tri
(prim-index uint16 :offset 52) ;; in the collide-cache-prim list
(user16 uint16 :offset 54)
(user32 uint32 2 :offset 56)
((vertex vector 3 :inline) ;; actual locations
(extra-quad uint128 :offset 48)
(pat pat-surface :overlay-at extra-quad) ; metadata about the surface of this tri
(prim-index uint16 :offset 52) ; in the collide-cache-prim list
(user16 uint16 :offset 54)
(user32 uint32 2 :offset 56)
)
:method-count-assert 9
:size-assert #x40
:flag-assert #x900000040
)
;; The primitives stored in the cache.
;; The "core" is extracted from the normal collide-shape-prim and placed inline here.
(deftype collide-cache-prim (structure)
((prim-core collide-prim-core :inline :offset-assert 0)
(extra-quad uint128 :offset-assert 32)
(ccache collide-cache :offset 32)
(prim collide-shape-prim :offset 36)
(first-tri uint16 :offset 40)
(num-tris uint16 :offset 42)
(unused uint8 4 :offset 44)
(world-sphere vector :inline :offset 0)
(collide-as collide-kind :offset 16)
(action collide-action :offset 24)
(offense collide-offense :offset 28)
(prim-type int8 :offset 29)
((prim-core collide-prim-core :inline)
(extra-quad uint128)
(ccache collide-cache :overlay-at extra-quad)
(prim collide-shape-prim :offset 36)
(first-tri uint16 :offset 40)
(num-tris uint16 :offset 42)
(unused uint8 4 :offset 44)
(world-sphere vector :inline :overlay-at (-> prim-core world-sphere))
(collide-as collide-kind :overlay-at (-> prim-core collide-as))
(action collide-action :overlay-at (-> prim-core action))
(offense collide-offense :overlay-at (-> prim-core offense))
(prim-type int8 :overlay-at (-> prim-core prim-type))
)
:method-count-assert 11
:size-assert #x30
:flag-assert #xb00000030
(:methods
(resolve-moving-sphere-tri (_type_ collide-tri-result collide-prim-core vector float collide-action) float 9)
(resolve-moving-sphere-sphere (_type_ collide-tri-result collide-prim-core vector float collide-action) float 10)
(resolve-moving-sphere-tri (_type_ collide-tri-result collide-prim-core vector float collide-action) float)
(resolve-moving-sphere-sphere (_type_ collide-tri-result collide-prim-core vector float collide-action) float)
)
)
;; The actual cache!
(deftype collide-cache (basic)
((num-tris int32 :offset-assert 4)
(num-prims int32 :offset-assert 8)
(num-prims-u uint32 :offset 8)
(ignore-mask pat-surface :offset-assert 12)
(proc process-drawable :offset-assert 16) ;; types: target
(collide-box bounding-box :inline :offset-assert 32)
(collide-box4w bounding-box4w :inline :offset-assert 64)
(collide-with collide-kind :offset-assert 96)
(prims collide-cache-prim 100 :inline :offset-assert 112)
(tris collide-cache-tri 461 :inline :offset-assert 4912)
((num-tris int32)
(num-prims int32)
(num-prims-u uint32 :overlay-at num-prims)
(ignore-mask pat-surface)
(proc process-drawable)
(collide-box bounding-box :inline)
(collide-box4w bounding-box4w :inline)
(collide-with collide-kind)
(prims collide-cache-prim 100 :inline)
(tris collide-cache-tri 461 :inline)
)
:method-count-assert 33
:size-assert #x8670
:flag-assert #x2100008670
(:methods
(debug-draw (_type_) none 9)
(fill-and-probe-using-line-sphere (_type_ vector vector float collide-kind process collide-tri-result pat-surface) float 10)
(fill-and-probe-using-spheres (_type_ collide-using-spheres-params) symbol 11)
(fill-and-probe-using-y-probe (_type_ vector float collide-kind process-drawable collide-tri-result pat-surface) float 12)
(fill-using-bounding-box (_type_ bounding-box collide-kind process-drawable pat-surface) none 13)
(fill-using-line-sphere (_type_ vector vector float collide-kind process-drawable pat-surface) none 14)
(fill-using-spheres (_type_ collide-using-spheres-params) none 15)
(fill-using-y-probe (_type_ vector float collide-kind process-drawable pat-surface) none 16)
(initialize (_type_) none 17)
(probe-using-line-sphere (_type_ vector vector float collide-kind collide-tri-result pat-surface) float 18)
(probe-using-spheres (_type_ collide-using-spheres-params) symbol 19)
(probe-using-y-probe (_type_ vector float collide-kind collide-tri-result pat-surface) float 20)
(fill-from-background (_type_ (function bsp-header int collide-list none) (function collide-cache object none)) none 21) ;; second functiom is method 28
(fill-from-foreground-using-box (_type_) none 22)
(fill-from-foreground-using-line-sphere (_type_) none 23)
(fill-from-foreground-using-y-probe (_type_) none 24)
(fill-from-water (_type_ water-control) none 25) ;; or whatever is from 152 in the process passed to 16
(load-mesh-from-spad-in-box (_type_ collide-frag-mesh) none 26)
(collide-cache-method-27 (_type_) none 27)
(collide-cache-method-28 (_type_) none 28)
(collide-cache-method-29 (_type_ collide-frag-mesh) none 29)
(puyp-mesh (_type_ collide-puyp-work collide-cache-prim) none 30)
(puyp-sphere (_type_ collide-puyp-work collide-cache-prim) vector 31)
(unpack-background-collide-mesh (_type_ object object object) none 32) ;; helper for fill from background.
(debug-draw (_type_) none)
(fill-and-probe-using-line-sphere (_type_ vector vector float collide-kind process collide-tri-result pat-surface) float)
(fill-and-probe-using-spheres (_type_ collide-using-spheres-params) symbol)
(fill-and-probe-using-y-probe (_type_ vector float collide-kind process-drawable collide-tri-result pat-surface) float)
(fill-using-bounding-box (_type_ bounding-box collide-kind process-drawable pat-surface) none)
(fill-using-line-sphere (_type_ vector vector float collide-kind process-drawable pat-surface) none)
(fill-using-spheres (_type_ collide-using-spheres-params) none)
(fill-using-y-probe (_type_ vector float collide-kind process-drawable pat-surface) none)
(initialize (_type_) none)
(probe-using-line-sphere (_type_ vector vector float collide-kind collide-tri-result pat-surface) float)
(probe-using-spheres (_type_ collide-using-spheres-params) symbol)
(probe-using-y-probe (_type_ vector float collide-kind collide-tri-result pat-surface) float)
(fill-from-background (_type_ (function bsp-header int collide-list none) (function collide-cache object none)) none)
(fill-from-foreground-using-box (_type_) none)
(fill-from-foreground-using-line-sphere (_type_) none)
(fill-from-foreground-using-y-probe (_type_) none)
(fill-from-water (_type_ water-control) none)
(load-mesh-from-spad-in-box (_type_ collide-frag-mesh) none)
(collide-cache-method-27 (_type_) none)
(collide-cache-method-28 (_type_) none)
(collide-cache-method-29 (_type_ collide-frag-mesh) none)
(puyp-mesh (_type_ collide-puyp-work collide-cache-prim) none)
(puyp-sphere (_type_ collide-puyp-work collide-cache-prim) vector)
(unpack-background-collide-mesh (_type_ object object object) none)
)
)
(deftype collide-list-item (structure)
((mesh collide-frag-mesh :offset-assert 0)
(inst basic :offset-assert 4)
((mesh collide-frag-mesh)
(inst basic)
)
:method-count-assert 9
:size-assert #x8
:flag-assert #x900000008
)
(deftype collide-list (structure)
((num-items int32 :offset-assert 0)
(items collide-list-item 256 :inline :offset-assert 16)
((num-items int32)
(items collide-list-item 256 :inline)
)
:method-count-assert 9
:size-assert #x1010
:flag-assert #x900001010
)
(deftype collide-work (structure)
((collide-sphere-neg-r sphere :inline :offset-assert 0)
(collide-box4w bounding-box4w :inline :offset-assert 16)
(inv-mat matrix :inline :offset-assert 48)
((collide-sphere-neg-r sphere :inline)
(collide-box4w bounding-box4w :inline)
(inv-mat matrix :inline)
)
:method-count-assert 9
:size-assert #x70
:flag-assert #x900000070
)
@@ -16,80 +16,65 @@
;; DECOMP BEGINS
(deftype edge-grab-info (structure)
((world-vertex vector 6 :inline :offset-assert 0)
(local-vertex vector 6 :inline :offset-assert 96)
(actor-cshape-prim-offset int32 :offset-assert 192)
(actor-handle handle :offset-assert 200)
(hanging-matrix matrix :inline :offset-assert 208)
(edge-vertex vector 2 :inline :offset 0)
(center-hold vector :inline :offset 32)
(tri-vertex vector 3 :inline :offset 48)
(left-hand-hold vector :inline :offset-assert 272)
(right-hand-hold vector :inline :offset-assert 288)
(center-hold-old vector :inline :offset-assert 304)
(edge-tri-pat uint32 :offset-assert 320)
((world-vertex vector 6 :inline)
(local-vertex vector 6 :inline)
(actor-cshape-prim-offset int32)
(actor-handle handle)
(hanging-matrix matrix :inline)
(edge-vertex vector 2 :inline :overlay-at (-> world-vertex 0))
(center-hold vector :inline :overlay-at (-> world-vertex 2))
(tri-vertex vector 3 :inline :overlay-at (-> world-vertex 3))
(left-hand-hold vector :inline)
(right-hand-hold vector :inline)
(center-hold-old vector :inline)
(edge-tri-pat uint32)
)
:method-count-assert 11
:size-assert #x144
:flag-assert #xb00000144
(:methods
(edge-grab-info-method-9 (_type_) symbol 9)
(debug-draw (_type_) symbol 10)
(edge-grab-info-method-9 (_type_) symbol)
(debug-draw (_type_) symbol)
)
)
;; og:preserve-this
(declare-type collide-cache-tri structure)
(deftype collide-edge-tri (structure)
((ctri collide-cache-tri :offset-assert 0)
(normal vector :inline :offset-assert 16)
((ctri collide-cache-tri)
(normal vector :inline)
)
:method-count-assert 9
:size-assert #x20
:flag-assert #x900000020
)
(deftype collide-edge-edge (structure)
((ignore basic :offset-assert 0)
(etri collide-edge-tri :offset-assert 4)
(vertex-ptr (inline-array vector) 2 :offset-assert 8)
(outward vector :inline :offset-assert 16)
(edge-vec-norm vector :inline :offset-assert 32)
((ignore basic)
(etri collide-edge-tri)
(vertex-ptr (inline-array vector) 2)
(outward vector :inline)
(edge-vec-norm vector :inline)
)
:method-count-assert 9
:size-assert #x30
:flag-assert #x900000030
)
(deftype collide-edge-hold-item (structure)
((next collide-edge-hold-item :offset-assert 0)
(rating float :offset-assert 4)
(split int8 :offset-assert 8)
(edge collide-edge-edge :offset-assert 12)
(center-pt vector :inline :offset-assert 16)
(outward-pt vector :inline :offset-assert 32)
((next collide-edge-hold-item)
(rating float)
(split int8)
(edge collide-edge-edge)
(center-pt vector :inline)
(outward-pt vector :inline)
)
:method-count-assert 9
:size-assert #x30
:flag-assert #x900000030
)
(deftype collide-edge-hold-list (structure)
((num-allocs uint32 :offset-assert 0)
(num-attempts uint32 :offset-assert 4)
(head collide-edge-hold-item :offset-assert 8)
(items collide-edge-hold-item 32 :inline :offset-assert 16)
(attempts qword 32 :inline :offset-assert 1552)
((num-allocs uint32)
(num-attempts uint32)
(head collide-edge-hold-item)
(items collide-edge-hold-item 32 :inline)
(attempts qword 32 :inline)
)
:method-count-assert 11
:size-assert #x810
:flag-assert #xb00000810
(:methods
(debug-draw (_type_) object 9)
(add-to-list! (_type_ collide-edge-hold-item) none 10)
(debug-draw (_type_) object)
(add-to-list! (_type_ collide-edge-hold-item) none)
)
)
@@ -97,48 +82,45 @@
(declare-type collide-cache basic)
(declare-type collide-shape basic)
(deftype collide-edge-work (structure)
((ccache collide-cache :offset-assert 0)
(cshape collide-shape :offset-assert 4)
(num-verts uint32 :offset-assert 8)
(num-edges uint32 :offset-assert 12)
(num-tris uint32 :offset-assert 16)
(cache-fill-box bounding-box :inline :offset-assert 32)
(within-reach-box bounding-box :inline :offset-assert 64)
(within-reach-box4w bounding-box4w :inline :offset-assert 96)
(search-pt vector :inline :offset-assert 128)
(search-dir-vec vector :inline :offset-assert 144)
(max-dist-sqrd-to-outward-pt float :offset-assert 160)
(max-dir-cosa-delta float :offset-assert 164)
(split-dists float 2 :offset-assert 168)
(outward-offset vector :inline :offset-assert 176)
(local-cache-fill-box bounding-box :inline :offset-assert 192)
(local-within-reach-box bounding-box :inline :offset-assert 224)
(local-player-spheres sphere 12 :inline :offset-assert 256)
(world-player-spheres sphere 12 :inline :offset-assert 448)
(local-player-hanging-spheres sphere 6 :inline :offset 256)
(world-player-hanging-spheres sphere 6 :inline :offset 448)
(local-player-leap-up-spheres sphere 6 :inline :offset 352)
(world-player-leap-up-spheres sphere 6 :inline :offset 544)
(verts vector 64 :inline :offset-assert 640)
(edges collide-edge-edge 96 :inline :offset-assert 1664)
(tris collide-edge-tri 48 :inline :offset-assert 6272)
(hold-list collide-edge-hold-list :inline :offset-assert 7808)
((ccache collide-cache)
(cshape collide-shape)
(num-verts uint32)
(num-edges uint32)
(num-tris uint32)
(cache-fill-box bounding-box :inline)
(within-reach-box bounding-box :inline)
(within-reach-box4w bounding-box4w :inline)
(search-pt vector :inline)
(search-dir-vec vector :inline)
(max-dist-sqrd-to-outward-pt float)
(max-dir-cosa-delta float)
(split-dists float 2)
(outward-offset vector :inline)
(local-cache-fill-box bounding-box :inline)
(local-within-reach-box bounding-box :inline)
(local-player-spheres sphere 12 :inline)
(world-player-spheres sphere 12 :inline)
(local-player-hanging-spheres sphere 6 :inline :overlay-at (-> local-player-spheres 0))
(world-player-hanging-spheres sphere 6 :inline :overlay-at (-> world-player-spheres 0))
(local-player-leap-up-spheres sphere 6 :inline :overlay-at (-> local-player-spheres 6))
(world-player-leap-up-spheres sphere 6 :inline :overlay-at (-> world-player-spheres 6))
(verts vector 64 :inline)
(edges collide-edge-edge 96 :inline)
(tris collide-edge-tri 48 :inline)
(hold-list collide-edge-hold-list :inline)
)
:method-count-assert 20
:size-assert #x2690
:flag-assert #x1400002690
(:methods
(search-for-edges (_type_ collide-edge-hold-list) symbol 9)
(debug-draw-edges (_type_) object 10)
(debug-draw-tris (_type_) none 11)
(debug-draw-sphere (_type_) symbol 12)
(compute-center-point! (_type_ collide-edge-edge vector) float 13)
(collide-edge-work-method-14 (_type_ vector vector int) float 14)
(find-grabbable-edges! (_type_) none 15)
(find-grabbable-tris! (_type_) none 16)
(should-add-to-list? (_type_ collide-edge-hold-item collide-edge-edge) symbol 17)
(find-best-grab! (_type_ collide-edge-hold-list edge-grab-info) symbol 18)
(check-grab-for-collisions (_type_ collide-edge-hold-item edge-grab-info) symbol 19)
(search-for-edges (_type_ collide-edge-hold-list) symbol)
(debug-draw-edges (_type_) object)
(debug-draw-tris (_type_) none)
(debug-draw-sphere (_type_) symbol)
(compute-center-point! (_type_ collide-edge-edge vector) float)
(collide-edge-work-method-14 (_type_ vector vector int) float)
(find-grabbable-edges! (_type_) none)
(find-grabbable-tris! (_type_) none)
(should-add-to-list? (_type_ collide-edge-hold-item collide-edge-edge) symbol)
(find-best-grab! (_type_ collide-edge-hold-list edge-grab-info) symbol)
(check-grab-for-collisions (_type_ collide-edge-hold-item edge-grab-info) symbol)
)
)
@@ -7,7 +7,7 @@
;; DECOMP BEGINS
(defmethod find-edge-grabs! target ((this target) (arg0 collide-cache))
(defmethod find-edge-grabs! ((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)
@@ -90,7 +90,7 @@
)
)
(defmethod search-for-edges collide-edge-work ((this collide-edge-work) (arg0 collide-edge-hold-list))
(defmethod search-for-edges ((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))
@@ -125,20 +125,17 @@
(defmethod-mips2c "(method 10 collide-edge-hold-list)" 10 collide-edge-hold-list)
(deftype pbhp-stack-vars (structure)
((edge collide-edge-edge :offset-assert 0)
(allocated basic :offset-assert 4)
(neg-hold-pt vector :inline :offset-assert 16)
(split-vec vector :inline :offset-assert 32)
((edge collide-edge-edge)
(allocated basic)
(neg-hold-pt vector :inline)
(split-vec vector :inline)
)
:method-count-assert 9
:size-assert #x30
:flag-assert #x900000030
)
(defmethod-mips2c "(method 18 collide-edge-work)" 18 collide-edge-work)
(defmethod check-grab-for-collisions collide-edge-work ((this collide-edge-work) (arg0 collide-edge-hold-item) (arg1 edge-grab-info))
(defmethod check-grab-for-collisions ((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))
@@ -231,7 +228,7 @@
#t
)
(defmethod edge-grab-info-method-9 edge-grab-info ((this edge-grab-info))
(defmethod edge-grab-info-method-9 ((this edge-grab-info))
(local-vars (v0-0 symbol) (v1-14 int))
(rlet ((acc :class vf)
(Q :class vf)
@@ -366,7 +363,7 @@
(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 ((this collide-edge-work) (arg0 vector) (arg1 vector) (arg2 int))
(defmethod collide-edge-work-method-14 ((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 (-> this num-edges)))
@@ -482,7 +479,7 @@
)
)
(defmethod compute-center-point! collide-edge-work ((this collide-edge-work) (arg0 collide-edge-edge) (arg1 vector))
(defmethod compute-center-point! ((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)
@@ -550,7 +547,7 @@
)
(defmethod debug-draw edge-grab-info ((this edge-grab-info))
(defmethod debug-draw ((this edge-grab-info))
(add-debug-line
#t
(bucket-id debug-no-zbuf)
@@ -603,7 +600,7 @@
)
)
(defmethod debug-draw-edges collide-edge-work ((this collide-edge-work))
(defmethod debug-draw-edges ((this collide-edge-work))
(let ((gp-0 0))
(dotimes (s4-0 (the-as int (-> this num-edges)))
(let* ((s3-0 (-> this edges s4-0))
@@ -652,7 +649,7 @@
)
)
(defmethod debug-draw-sphere collide-edge-work ((this collide-edge-work))
(defmethod debug-draw-sphere ((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))
@@ -661,7 +658,7 @@
#f
)
(defmethod debug-draw collide-edge-hold-list ((this collide-edge-hold-list))
(defmethod debug-draw ((this collide-edge-hold-list))
(let ((s4-0 (-> this head))
(s5-0 0)
)
@@ -713,7 +710,7 @@
(format *stdcon* "hold list has ~D attempt(s)~%" (-> this num-attempts))
)
(defmethod debug-draw-tris collide-edge-work ((this collide-edge-work))
(defmethod debug-draw-tris ((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))
+19 -29
View File
@@ -22,47 +22,37 @@
(deftype collide-frag-vertex (vector)
()
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
(deftype collide-frag-mesh (basic)
((packed-data uint32 :offset-assert 4)
(pat-array uint32 :offset-assert 8)
(strip-data-len uint16 :offset-assert 12)
(poly-count uint16 :offset-assert 14)
(base-trans vector :inline :offset-assert 16)
(vertex-count uint8 :offset 28)
(vertex-data-qwc uint8 :offset 29)
(total-qwc uint8 :offset 30)
(unused uint8 :offset 31)
((packed-data uint32)
(pat-array uint32)
(strip-data-len uint16)
(poly-count uint16)
(base-trans vector :inline)
(vertex-count uint8 :overlay-at (-> base-trans w))
(vertex-data-qwc uint8 :offset 29)
(total-qwc uint8 :offset 30)
(unused uint8 :offset 31)
)
:method-count-assert 9
:size-assert #x20
:flag-assert #x900000020
)
(deftype collide-fragment (drawable)
((mesh collide-frag-mesh :offset 8)
((mesh collide-frag-mesh :offset 8)
)
:method-count-assert 18
:size-assert #x20
:flag-assert #x1200000020
)
(deftype drawable-inline-array-collide-fragment (drawable-inline-array)
((data collide-fragment 1 :inline :offset-assert 32)
(pad uint32 :offset-assert 64)
((data collide-fragment 1 :inline)
(pad uint32)
)
:method-count-assert 18
:size-assert #x44
:flag-assert #x1200000044
)
(deftype drawable-tree-collide-fragment (drawable-tree)
((data-override drawable-inline-array :offset 32))
:method-count-assert #x12
:size-assert #x24
:flag-assert #x1200000024
)
((data-override drawable-inline-array :overlay-at (-> data 0))
)
)
+20 -19
View File
@@ -5,15 +5,15 @@
;; 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 ((this drawable-tree-collide-fragment))
;; DECOMP BEGINS
(defmethod login ((this drawable-tree-collide-fragment))
this
)
(defmethod draw drawable-tree-collide-fragment ((this drawable-tree-collide-fragment) (arg0 drawable-tree-collide-fragment) (arg1 display-frame))
(defmethod draw ((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 (-> this length))
@@ -24,30 +24,30 @@
(none)
)
(defmethod unpack-vis drawable-tree-collide-fragment ((this drawable-tree-collide-fragment) (arg0 (pointer int8)) (arg1 (pointer int8)))
(defmethod unpack-vis ((this drawable-tree-collide-fragment) (arg0 (pointer int8)) (arg1 (pointer int8)))
arg1
)
(defmethod collide-with-box drawable-tree-collide-fragment ((this drawable-tree-collide-fragment) (arg0 int) (arg1 collide-list))
(defmethod collide-with-box ((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 (-> this data-override) (-> this length) arg1)
0
(none)
)
(defmethod collide-y-probe drawable-tree-collide-fragment ((this drawable-tree-collide-fragment) (arg0 int) (arg1 collide-list))
(defmethod collide-y-probe ((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 ((this drawable-tree-collide-fragment) (arg0 int) (arg1 collide-list))
(defmethod collide-ray ((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 ((this collide-fragment) (arg0 memory-usage-block) (arg1 int))
(defmethod mem-usage ((this collide-fragment) (arg0 memory-usage-block) (arg1 int))
(let ((s5-0 (if (logtest? arg1 1)
53
50
@@ -79,11 +79,11 @@
)
)
(defmethod login drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment))
(defmethod login ((this drawable-inline-array-collide-fragment))
this
)
(defmethod draw collide-fragment ((this collide-fragment) (arg0 collide-fragment) (arg1 display-frame))
(defmethod draw ((this collide-fragment) (arg0 collide-fragment) (arg1 display-frame))
;; if we wanted to draw collide-fragment's we'd do it here.
; (when (< (-> this bsphere w) (meters 22.))
; (format 0 "sp: ~m : ~D~%" (-> this bsphere w) (-> this mesh poly-count))
@@ -98,13 +98,14 @@
; ;(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) (-> this bsphere))
0
(none)
)
(defmethod draw drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment)
(arg0 drawable-inline-array-collide-fragment)
(arg1 display-frame)
)
(defmethod draw ((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))
@@ -116,25 +117,25 @@
(none)
)
(defmethod collide-with-box drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment) (arg0 int) (arg1 collide-list))
(defmethod collide-with-box ((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-y-probe drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment) (arg0 int) (arg1 collide-list))
(defmethod collide-y-probe ((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 collide-ray drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment) (arg0 int) (arg1 collide-list))
(defmethod collide-ray ((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))
(defmethod mem-usage ((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)
+31 -46
View File
@@ -17,14 +17,11 @@
;; 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)
(intersect vector :inline)
(normal vector :inline)
(pat pat-surface)
)
:method-count-assert 9
:size-assert #x54
:flag-assert #x900000054
)
;;;;;;;;;;;;;;;;;;;;
@@ -35,14 +32,11 @@
;; 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)
(unused uint8)
(pat pat-surface)
)
:pack-me
:method-count-assert 9
:size-assert #x8
:flag-assert #x900000008
)
;; og:preserve-this
@@ -50,23 +44,20 @@
;; 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)
(num-tris uint32)
(num-verts uint32)
(vertex-data (inline-array vector))
(tris collide-mesh-tri 1 :inline :offset 32)
)
:method-count-assert 16
:size-assert #x28
:flag-assert #x1000000028
(:methods
(debug-draw-tris (_type_ process-drawable int) none 9)
(overlap-test (_type_ collide-mesh-cache-tri vector) symbol 10)
(should-push-away-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float 11) ;; spat
(sphere-on-platform-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float 12) ;; sopt
(populate-cache! (_type_ collide-mesh-cache-tri matrix) none 13)
(collide-mesh-math-1 (_type_ object object) none 14)
(collide-mesh-math-2 (_type_ object object object) none 15)
(debug-draw-tris (_type_ process-drawable int) none)
(overlap-test (_type_ collide-mesh-cache-tri vector) symbol)
(should-push-away-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float)
(sphere-on-platform-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float)
(populate-cache! (_type_ collide-mesh-cache-tri matrix) none)
(collide-mesh-math-1 (_type_ object object) none)
(collide-mesh-math-2 (_type_ object object object) none)
)
)
@@ -84,18 +75,15 @@
(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 40960 :offset 32)
((used-size uint32)
(max-size uint32)
(id uint64)
(data uint8 40960 :offset 32)
)
:method-count-assert 12
:size-assert #xa020
:flag-assert #xc0000a020
(:methods
(allocate! (_type_ int) int 9)
(is-id? (_type_ int) symbol 10)
(next-id! (_type_) uint 11)
(allocate! (_type_ int) int)
(is-id? (_type_ int) symbol)
(next-id! (_type_) uint)
)
)
@@ -121,21 +109,18 @@
)
)
(defmethod is-id? collide-mesh-cache ((this collide-mesh-cache) (arg0 int))
(defmethod is-id? ((this collide-mesh-cache) (arg0 int))
"Is this our id?"
(= (-> 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)
(normal vector :inline)
(bbox4w bounding-box4w :inline)
(pat pat-surface :overlay-at (-> normal w))
)
:method-count-assert 9
:size-assert #x60
:flag-assert #x900000060
)
;; only allocate if we don't have an existing one.
+19 -17
View File
@@ -7,12 +7,12 @@
;; DECOMP BEGINS
(defmethod asize-of collide-mesh ((this collide-mesh))
(defmethod asize-of ((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) (* (+ (-> this num-tris) -1) 8)))
)
(defmethod mem-usage collide-mesh ((this collide-mesh) (arg0 memory-usage-block) (arg1 int))
(defmethod mem-usage ((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")
@@ -31,7 +31,7 @@
(the-as collide-mesh 0)
)
(defmethod debug-draw-tris collide-mesh ((this collide-mesh) (arg0 process-drawable) (arg1 int))
(defmethod debug-draw-tris ((this collide-mesh) (arg0 process-drawable) (arg1 int))
"Draw a collide-mesh."
(rlet ((acc :class vf)
(vf0 :class vf)
@@ -87,32 +87,28 @@
)
(deftype sopt-work (structure)
((intersect vector :inline :offset-assert 0)
(sphere-bbox4w bounding-box4w :inline :offset-assert 16)
((intersect vector :inline)
(sphere-bbox4w bounding-box4w :inline)
)
:method-count-assert 9
:size-assert #x30
:flag-assert #x900000030
)
(defmethod-mips2c "(method 12 collide-mesh)" 12 collide-mesh)
(deftype spat-work (structure)
((intersect vector :inline :offset-assert 0)
(sphere-bbox4w bounding-box4w :inline :offset-assert 16)
((intersect vector :inline)
(sphere-bbox4w bounding-box4w :inline)
)
:method-count-assert 9
:size-assert #x30
:flag-assert #x900000030
)
(defmethod-mips2c "(method 11 collide-mesh)" 11 collide-mesh)
(defmethod-mips2c "(method 14 collide-mesh)" 14 collide-mesh)
(defmethod-mips2c "(method 15 collide-mesh)" 15 collide-mesh)
(defmethod allocate! collide-mesh-cache ((this collide-mesh-cache) (arg0 int))
(defmethod allocate! ((this collide-mesh-cache) (arg0 int))
(local-vars (a1-2 int) (a2-2 int))
(let* ((v1-0 (+ arg0 15))
(a1-1 (-> this used-size))
@@ -146,7 +142,7 @@
)
)
(defmethod populate-cache! collide-mesh ((this collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 matrix))
(defmethod populate-cache! ((this collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 matrix))
(local-vars (t0-2 uint))
(rlet ((acc :class vf)
(Q :class vf)
@@ -314,8 +310,14 @@
)
)
(deftype oot-work (structure)
((intersect vector :inline)
(sphere-bbox4w bounding-box4w :inline)
)
)
(defmethod overlap-test collide-mesh ((this collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 vector))
(defmethod overlap-test ((this collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 vector))
(local-vars
(zero uint128)
(v1-0 uint128)
@@ -136,20 +136,15 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(deftype collide-probe-stack-elem (structure)
((child uint32 :offset-assert 0)
(count uint32 :offset-assert 4)
((child uint32)
(count uint32)
)
:method-count-assert 9
:size-assert #x8
:flag-assert #x900000008
)
(deftype collide-probe-stack (structure)
((data collide-probe-stack-elem 1024 :inline :offset-assert 0)
((data collide-probe-stack-elem 1024 :inline)
)
:method-count-assert 9
:size-assert #x4000
:flag-assert #x900004000
)
;;(define *collide-probe-stack* (the-as pointer (+ 4192 #x70000000)))
+209 -265
View File
@@ -95,20 +95,18 @@
(deftype collide-sticky-rider (structure)
((rider-handle handle :offset-assert 0)
(sticky-prim collide-shape-prim :offset-assert 8)
(prim-ry float :offset-assert 12)
(rider-local-pos vector :inline :offset-assert 16)
((rider-handle handle)
(sticky-prim collide-shape-prim)
(prim-ry float)
(rider-local-pos vector :inline)
)
:method-count-assert 10
:size-assert #x20
:flag-assert #xa00000020
(:methods
(set-rider! (_type_ handle) symbol 9)
(set-rider! (_type_ handle) symbol)
)
)
(defmethod set-rider! collide-sticky-rider ((this collide-sticky-rider) (arg0 handle))
(defmethod set-rider! ((this collide-sticky-rider) (arg0 handle))
"Set the rider and clear the primitive."
(set! (-> this rider-handle) arg0)
(set! (-> this sticky-prim) #f)
@@ -118,21 +116,19 @@
;; A collection of collide-sticky-riders
;; dynamic type. There's one collide-sticky-rider per rider.
(deftype collide-sticky-rider-group (basic)
((num-riders int32 :offset-assert 4)
(allocated-riders int32 :offset-assert 8)
(rider collide-sticky-rider 1 :inline :offset-assert 16)
((num-riders int32)
(allocated-riders int32)
(rider collide-sticky-rider 1 :inline)
)
:method-count-assert 11
:size-assert #x30
:flag-assert #xb00000030
(:methods
(new (symbol type int) _type_ 0)
(add-rider! (_type_ process-drawable) collide-sticky-rider 9)
(reset! (_type_) int 10)
(new (symbol type int) _type_)
(add-rider! (_type_ process-drawable) collide-sticky-rider)
(reset! (_type_) int)
)
)
(defmethod reset! collide-sticky-rider-group ((this collide-sticky-rider-group))
(defmethod reset! ((this collide-sticky-rider-group))
"Reset all active riders"
(set! (-> this num-riders) 0)
0
@@ -141,14 +137,11 @@
;; The rider will be pulled along by the object.
;; This includes possibly rotating the rider (if the platform spins, it spins Jak too).
(deftype pull-rider-info (structure)
((rider collide-sticky-rider :offset-assert 0)
(rider-cshape collide-shape-moving :offset-assert 4)
(rider-delta-ry float :offset-assert 8)
(rider-dest vector :inline :offset-assert 16)
((rider collide-sticky-rider)
(rider-cshape collide-shape-moving)
(rider-delta-ry float)
(rider-dest vector :inline)
)
:method-count-assert 9
:size-assert #x20
:flag-assert #x900000020
)
@@ -160,38 +153,32 @@
;; this computes a "move-vec" and "u". If you move along "move-vec" by "u", you will move out of collsion.
;; It also tells you which primitives are colliding.
(deftype collide-shape-intersect (basic)
((move-vec vector :inline :offset-assert 16)
(best-u float :offset-assert 32)
(best-tri collide-tri-result :inline :offset-assert 48)
(best-from-prim collide-shape-prim :offset-assert 132)
(best-to-prim collide-shape-prim :offset-assert 136)
((move-vec vector :inline)
(best-u float)
(best-tri collide-tri-result :inline)
(best-from-prim collide-shape-prim)
(best-to-prim collide-shape-prim)
)
:method-count-assert 10
:size-assert #x8c
:flag-assert #xa0000008c
(:methods
(init! (_type_ vector) symbol 9)
(init! (_type_ vector) symbol)
)
)
;; Collision with just overlap distance, no vector.
(deftype collide-overlap-result (structure)
((best-dist float :offset-assert 0)
(best-from-prim collide-shape-prim :offset-assert 4)
(best-to-prim collide-shape-prim :offset-assert 8)
(best-from-tri collide-tri-result :inline :offset-assert 16)
((best-dist float)
(best-from-prim collide-shape-prim)
(best-to-prim collide-shape-prim)
(best-from-tri collide-tri-result :inline)
)
:method-count-assert 10
:size-assert #x64
:flag-assert #xa00000064
(:methods
(reset! (_type_) none 9)
(reset! (_type_) none)
)
)
(defmethod reset! collide-overlap-result ((this collide-overlap-result))
"Reset the result."
(defmethod reset! ((this collide-overlap-result))
"Reset the result."
(set! (-> this best-dist) 0.0)
(set! (-> this best-from-prim) #f)
(set! (-> this best-to-prim) #f)
@@ -206,12 +193,9 @@
;; but this isn't well understood yet
(deftype overlaps-others-params (structure)
((options uint32 :offset-assert 0)
(tlist touching-list :offset-assert 4)
((options uint32)
(tlist touching-list)
)
:method-count-assert 9
:size-assert #x8
:flag-assert #x900000008
)
;; The engine system is used to link collision checks with processes.
@@ -344,17 +328,14 @@
;; this is a 32-byte chunk of data that can be pulled out an put in collide caches
;; it stores the transformed world sphere and the collision settings
(deftype collide-prim-core (structure)
((world-sphere vector :inline :offset-assert 0)
(collide-as collide-kind :offset-assert 16) ;; what are we (enemy, etc)
(action collide-action :offset-assert 24) ;; what happens if we collide (physics)
(offense collide-offense :offset-assert 28) ;; how hard do we have to hit it? (touch, attack...)
(prim-type int8 :offset-assert 29) ;; what type of primtive do we belong to?
(extra uint8 2 :offset-assert 30)
(quad uint128 2 :offset 0)
((world-sphere vector :inline)
(collide-as collide-kind)
(action collide-action)
(offense collide-offense)
(prim-type int8)
(extra uint8 2)
(quad uint128 2 :overlay-at (-> world-sphere quad))
)
:method-count-assert 9
:size-assert #x20
:flag-assert #x900000020
)
(declare-type collide-shape basic)
@@ -364,45 +345,40 @@
;; the base class for collision shapes.
(deftype collide-shape-prim (basic)
((cshape collide-shape :offset-assert 4) ;; our parent collide-shape
(prim-id uint32 :offset-assert 8) ;; ?
(transform-index int8 :offset-assert 12) ;; ?
(prim-core collide-prim-core :inline :offset-assert 16) ;; core data
(local-sphere vector :inline :offset-assert 48) ;; sphere, pre transform
(collide-with collide-kind :offset-assert 64) ;; things we can collide with
;; overlays of core.
(world-sphere vector :inline :offset 16)
(collide-as collide-kind :offset 32)
(action collide-action :offset 40)
(offense collide-offense :offset 44)
(prim-type int8 :offset 45)
(radius meters :offset 60)
((cshape collide-shape)
(prim-id uint32)
(transform-index int8)
(prim-core collide-prim-core :inline)
(local-sphere vector :inline)
(collide-with collide-kind)
(world-sphere vector :inline :overlay-at (-> prim-core world-sphere))
(collide-as collide-kind :overlay-at (-> prim-core collide-as))
(action collide-action :overlay-at (-> prim-core action))
(offense collide-offense :overlay-at (-> prim-core offense))
(prim-type int8 :overlay-at (-> prim-core prim-type))
(radius meters :overlay-at (-> local-sphere w))
)
:method-count-assert 28
:size-assert #x48
:flag-assert #x1c00000048
(:methods
(new (symbol type collide-shape uint int) _type_ 0)
(move-by-vector! (_type_ vector) none 9)
(find-prim-by-id (_type_ uint) collide-shape-prim 10)
(debug-draw-world-sphere (_type_) symbol 11)
(add-fg-prim-using-box (_type_ collide-cache) none 12)
(add-fg-prim-using-line-sphere (_type_ collide-cache) none 13)
(add-fg-prim-using-y-probe (_type_ collide-cache) none 14)
(overlaps-others-test (_type_ overlaps-others-params collide-shape-prim) symbol 15)
(overlaps-others-group (_type_ overlaps-others-params collide-shape-prim-group) symbol 16)
(unused-17 () none 17)
(collide-with-collide-cache-prim-mesh (_type_ collide-shape-intersect collide-cache-prim) none 18)
(collide-with-collide-cache-prim-sphere (_type_ collide-shape-intersect collide-cache-prim) none 19)
(add-to-bounding-box (_type_ collide-kind) symbol 20)
(num-mesh (_type_ collide-shape-prim) int 21)
(on-platform-test (_type_ collide-shape-prim collide-overlap-result float) none 22)
(should-push-away-test (_type_ collide-shape-prim collide-overlap-result) none 23)
(should-push-away-reverse-test (_type_ collide-shape-prim-group collide-overlap-result) none 24)
(update-transforms! (_type_ process-drawable) symbol 25)
(set-collide-as! (_type_ collide-kind) none 26)
(set-collide-with! (_type_ collide-kind) none 27)
(new (symbol type collide-shape uint int) _type_)
(move-by-vector! (_type_ vector) none)
(find-prim-by-id (_type_ uint) collide-shape-prim)
(debug-draw-world-sphere (_type_) symbol)
(add-fg-prim-using-box (_type_ collide-cache) none)
(add-fg-prim-using-line-sphere (_type_ collide-cache) none)
(add-fg-prim-using-y-probe (_type_ collide-cache) none)
(overlaps-others-test (_type_ overlaps-others-params collide-shape-prim) symbol)
(overlaps-others-group (_type_ overlaps-others-params collide-shape-prim-group) symbol)
(unused-17 () none)
(collide-with-collide-cache-prim-mesh (_type_ collide-shape-intersect collide-cache-prim) none)
(collide-with-collide-cache-prim-sphere (_type_ collide-shape-intersect collide-cache-prim) none)
(add-to-bounding-box (_type_ collide-kind) symbol)
(num-mesh (_type_ collide-shape-prim) int)
(on-platform-test (_type_ collide-shape-prim collide-overlap-result float) none)
(should-push-away-test (_type_ collide-shape-prim collide-overlap-result) none)
(should-push-away-reverse-test (_type_ collide-shape-prim-group collide-overlap-result) none)
(update-transforms! (_type_ process-drawable) symbol)
(set-collide-as! (_type_ collide-kind) none)
(set-collide-with! (_type_ collide-kind) none)
)
)
@@ -418,13 +394,10 @@
;; the pat is stored directly here.
;; I believe the "local sphere" is used as the sphere.
(deftype collide-shape-prim-sphere (collide-shape-prim)
((pat pat-surface :offset-assert 72)
((pat pat-surface)
)
:method-count-assert 28
:size-assert #x4c
:flag-assert #x1c0000004c
(:methods
(new (symbol type collide-shape uint) _type_ 0)
(new (symbol type collide-shape uint) _type_)
)
)
@@ -433,35 +406,29 @@
;; These meshes interact with a cache automatically (a specific collide-shape-prim-mesh cache, not the
;; more general collide-cache)
(deftype collide-shape-prim-mesh (collide-shape-prim)
((mesh collide-mesh :offset-assert 72)
(mesh-id int32 :offset-assert 76)
(mesh-cache-id uint64 :offset-assert 80)
(mesh-cache-tris (inline-array collide-mesh-cache-tri) :offset-assert 88)
((mesh collide-mesh)
(mesh-id int32)
(mesh-cache-id uint64)
(mesh-cache-tris (inline-array collide-mesh-cache-tri))
)
:method-count-assert 29
:size-assert #x5c
:flag-assert #x1d0000005c
(:methods
(new (symbol type collide-shape uint uint) _type_ 0)
(change-mesh (_type_ int) none 28)
(new (symbol type collide-shape uint uint) _type_)
(change-mesh (_type_ int) none)
)
)
;; A group of collide-shape-prim's
(deftype collide-shape-prim-group (collide-shape-prim)
((num-prims int32 :offset-assert 72)
(num-prims-u uint32 :offset 72)
(allocated-prims int32 :offset-assert 76)
(prim collide-shape-prim 1 :offset-assert 80)
(prims collide-shape-prim :dynamic :offset 80) ;; added
((num-prims int32)
(num-prims-u uint32 :overlay-at num-prims)
(allocated-prims int32)
(prim collide-shape-prim 1)
(prims collide-shape-prim :dynamic :overlay-at (-> prim 0))
)
:method-count-assert 30
:size-assert #x54
:flag-assert #x1e00000054
(:methods
(new (symbol type collide-shape uint int) _type_ 0)
(append-prim (_type_ collide-shape-prim) none 28)
(add-to-non-empty-bounding-box (_type_ collide-kind) none 29)
(new (symbol type collide-shape uint int) _type_)
(append-prim (_type_ collide-shape-prim) none)
(add-to-non-empty-bounding-box (_type_ collide-kind) none)
)
)
@@ -472,7 +439,7 @@
;; This is sort of the "parent" of all collide prims for a process-drawable.
;; Each process-drawable (pd) should have one collide-shape, which is often the root.
;; It represents:
;; - the location of the thing in hte world
;; - the location of the thing in the world
;; - settings abouts collision/navigation
;; - riders
@@ -494,51 +461,48 @@
;; we're a child of trsqv, so we store a full transform + derivative.
(deftype collide-shape (trsqv)
((process process-drawable :offset-assert 140)
(max-iteration-count uint8 :offset-assert 144)
(nav-flags nav-flags :offset-assert 145)
(pad-byte uint8 2 :offset-assert 146)
(pat-ignore-mask pat-surface :offset-assert 148)
(event-self symbol :offset-assert 152)
(event-other symbol :offset-assert 156)
(root-prim collide-shape-prim :offset-assert 160)
(riders collide-sticky-rider-group :offset-assert 164)
(backup-collide-as collide-kind :offset-assert 168)
(backup-collide-with collide-kind :offset-assert 176)
((process process-drawable)
(max-iteration-count uint8)
(nav-flags nav-flags)
(pad-byte uint8 2)
(pat-ignore-mask pat-surface)
(event-self symbol)
(event-other symbol)
(root-prim collide-shape-prim)
(riders collide-sticky-rider-group)
(backup-collide-as collide-kind)
(backup-collide-with collide-kind)
)
:method-count-assert 56
:size-assert #xb8
:flag-assert #x38000000b8
(:methods
(new (symbol type process-drawable collide-list-enum) _type_ 0)
(move-by-vector! (_type_ vector) none 28)
(alloc-riders (_type_ int) none 29)
(move-to-point! (_type_ vector) none 30) ;; ret - symbol | float (CSPG::9)
(debug-draw (_type_) none 31)
(fill-cache-for-shape! (_type_ float collide-kind) none 32)
(fill-cache-integrate-and-collide! (_type_ vector collide-kind) none 33)
(find-prim-by-id (_type_ uint) collide-shape-prim 34)
(detect-riders! (_type_) symbol 35)
(build-bounding-box-for-shape (_type_ bounding-box float collide-kind) symbol 36)
(integrate-and-collide! (_type_ vector) none 37)
(find-collision-meshes (_type_) symbol 38)
(on-platform (_type_ collide-shape collide-overlap-result) symbol 39)
(find-overlapping-shapes (_type_ overlaps-others-params) symbol 40) ;; check if blocked??
(calc-shove-up (_type_ attack-info float) vector 41)
(should-push-away (_type_ collide-shape collide-overlap-result) symbol 42)
(pull-rider! (_type_ pull-rider-info) none 43)
(pull-riders! (_type_) symbol 44)
(do-push-aways! (_type_) symbol 45)
(set-root-prim! (_type_ collide-shape-prim) collide-shape-prim 46)
(update-transforms! (_type_) symbol 47)
(clear-collide-with-as (_type_) none 48)
(restore-collide-with-as (_type_) none 49)
(backup-collide-with-as (_type_) none 50)
(set-root-prim-collide-with! (_type_ collide-kind) none 51)
(set-root-prim-collide-as! (_type_ collide-kind) none 52)
(set-collide-kinds (_type_ int collide-kind collide-kind) none 53)
(set-collide-offense (_type_ int collide-offense) none 54)
(send-shove-back (_type_ process touching-shapes-entry float float float) none 55)
(new (symbol type process-drawable collide-list-enum) _type_)
(move-by-vector! (_type_ vector) none)
(alloc-riders (_type_ int) none)
(move-to-point! (_type_ vector) none)
(debug-draw (_type_) none)
(fill-cache-for-shape! (_type_ float collide-kind) none)
(fill-cache-integrate-and-collide! (_type_ vector collide-kind) none)
(find-prim-by-id (_type_ uint) collide-shape-prim)
(detect-riders! (_type_) symbol)
(build-bounding-box-for-shape (_type_ bounding-box float collide-kind) symbol)
(integrate-and-collide! (_type_ vector) none)
(find-collision-meshes (_type_) symbol)
(on-platform (_type_ collide-shape collide-overlap-result) symbol)
(find-overlapping-shapes (_type_ overlaps-others-params) symbol)
(calc-shove-up (_type_ attack-info float) vector)
(should-push-away (_type_ collide-shape collide-overlap-result) symbol)
(pull-rider! (_type_ pull-rider-info) none)
(pull-riders! (_type_) symbol)
(do-push-aways! (_type_) symbol)
(set-root-prim! (_type_ collide-shape-prim) collide-shape-prim)
(update-transforms! (_type_) symbol)
(clear-collide-with-as (_type_) none)
(restore-collide-with-as (_type_) none)
(backup-collide-with-as (_type_) none)
(set-root-prim-collide-with! (_type_ collide-kind) none)
(set-root-prim-collide-as! (_type_ collide-kind) none)
(set-collide-kinds (_type_ int collide-kind collide-kind) none)
(set-collide-offense (_type_ int collide-offense) none)
(send-shove-back (_type_ process touching-shapes-entry float float float) none)
)
)
@@ -616,45 +580,42 @@
;; A collide-shape for independently moving objects
(deftype collide-shape-moving (collide-shape)
((rider-time time-frame :offset-assert 184)
(rider-last-move vector :inline :offset-assert 192)
(trans-old vector 3 :inline :offset-assert 208)
(poly-pat pat-surface :offset-assert 256)
(cur-pat pat-surface :offset-assert 260)
(ground-pat pat-surface :offset-assert 264)
(status cshape-moving-flags :offset-assert 272)
(old-status cshape-moving-flags :offset-assert 280)
(prev-status cshape-moving-flags :offset-assert 288)
(reaction-flag cshape-reaction-flags :offset-assert 296)
(reaction (function collide-shape-moving collide-shape-intersect vector vector cshape-moving-flags) :offset-assert 300)
(no-reaction (function collide-shape-moving collide-shape-intersect vector vector none) :offset-assert 304)
(local-normal vector :inline :offset-assert 320)
(surface-normal vector :inline :offset-assert 336)
(poly-normal vector :inline :offset-assert 352)
(ground-poly-normal vector :inline :offset-assert 368)
(ground-touch-point vector :inline :offset-assert 384)
(shadow-pos vector :inline :offset-assert 400)
(ground-impact-vel meters :offset-assert 416)
(surface-angle float :offset-assert 420)
(poly-angle float :offset-assert 424)
(touch-angle float :offset-assert 428)
(coverage float :offset-assert 432)
(dynam dynamics :offset-assert 436)
(surf surface :offset-assert 440)
((rider-time time-frame)
(rider-last-move vector :inline)
(trans-old vector 3 :inline)
(poly-pat pat-surface)
(cur-pat pat-surface)
(ground-pat pat-surface)
(status cshape-moving-flags)
(old-status cshape-moving-flags)
(prev-status cshape-moving-flags)
(reaction-flag cshape-reaction-flags)
(reaction (function collide-shape-moving collide-shape-intersect vector vector cshape-moving-flags))
(no-reaction (function collide-shape-moving collide-shape-intersect vector vector none))
(local-normal vector :inline)
(surface-normal vector :inline)
(poly-normal vector :inline)
(ground-poly-normal vector :inline)
(ground-touch-point vector :inline)
(shadow-pos vector :inline)
(ground-impact-vel meters)
(surface-angle float)
(poly-angle float)
(touch-angle float)
(coverage float)
(dynam dynamics)
(surf surface)
)
:method-count-assert 65
:size-assert #x1bc
:flag-assert #x41000001bc
(:methods
(set-and-handle-pat! (_type_ pat-surface) none 56)
(integrate-no-collide! (_type_ vector) none 57)
(collide-shape-moving-method-58 (_type_ vector) symbol 58)
(integrate-for-enemy-with-move-to-ground! (_type_ vector collide-kind float symbol symbol symbol) none 59)
(move-to-ground (_type_ float float symbol collide-kind) symbol 60)
(move-to-ground-point! (_type_ vector vector vector) none 61)
(compute-acc-due-to-gravity (_type_ vector float) vector 62)
(step-collison! (_type_ vector vector float) float 63)
(move-to-tri! (_type_ collide-tri-result vector) none 64)
(set-and-handle-pat! (_type_ pat-surface) none)
(integrate-no-collide! (_type_ vector) none)
(collide-shape-moving-method-58 (_type_ vector) symbol)
(integrate-for-enemy-with-move-to-ground! (_type_ vector collide-kind float symbol symbol symbol) none)
(move-to-ground (_type_ float float symbol collide-kind) symbol)
(move-to-ground-point! (_type_ vector vector vector) none)
(compute-acc-due-to-gravity (_type_ vector float) vector)
(step-collison! (_type_ vector vector float) float)
(move-to-tri! (_type_ collide-tri-result vector) none)
)
)
@@ -663,24 +624,19 @@
;;;;;;;;;;;;;;;;;;;;
(defmethod new collide-shape-prim ((allocation symbol) (type-to-make type) (cshape collide-shape) (prim-id uint) (size-bytes int))
"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 ((this (object-new allocation type-to-make size-bytes)))
(set! (-> this cshape) (the-as collide-shape cshape))
;; sphere/mesh?
(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
(let ((v0-0 (object-new allocation type-to-make size-bytes)))
(set! (-> v0-0 cshape) cshape)
(set! (-> v0-0 prim-id) prim-id)
(set! (-> v0-0 prim-core action) (collide-action))
(set! (-> v0-0 prim-core collide-as) (collide-kind))
(set! (-> v0-0 collide-with) (collide-kind))
(set! (-> v0-0 transform-index) -2)
(set! (-> v0-0 prim-core offense) (collide-offense no-offense))
(set! (-> v0-0 prim-core prim-type) -2)
v0-0
)
)
(defmethod new collide-shape-prim-sphere ((allocation symbol) (type-to-make type) (cshape collide-shape) (prim-id uint))
"Allocate a new sphere primitive"
@@ -696,10 +652,10 @@
(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 mesh-id) (the-as int mesh-id))
(set! (-> this mesh-cache-id) (the-as uint 0))
(set! (-> this prim-core prim-type) 1)
this
(the-as collide-shape-prim-mesh this)
)
)
@@ -719,12 +675,12 @@
)
)
(defmethod length collide-shape-prim-group ((this collide-shape-prim-group))
(defmethod length ((this collide-shape-prim-group))
"How many primitives are used?"
(-> this num-prims)
)
(defmethod asize-of collide-shape-prim-group ((this collide-shape-prim-group))
(defmethod asize-of ((this collide-shape-prim-group))
"How big is this in memory?"
(the-as int (+ (-> this type size) (* (+ (-> this allocated-prims) -1) 4)))
)
@@ -741,13 +697,12 @@
(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! (-> this pat-ignore-mask) (new 'static 'pat-surface :skip #x2 :nocamera #x1))
(set! (-> this pat-ignore-mask) (new 'static 'pat-surface :nocamera #x1))
)
(else
(set! (-> this pat-ignore-mask) (new 'static 'pat-surface :skip #x1 :noentity #x1))
(set! (-> this pat-ignore-mask) (new 'static 'pat-surface :noentity #x1))
)
)
;; reset transformation to the origin.
@@ -770,7 +725,8 @@
(add-connection *collide-player-list* proc #f this #f #f))
(else
(format 0 "Unsupported collide-list-enum in collide-shape constructor!~%"))
(format 0 "Unsupported collide-list-enum in collide-shape constructor!~%")
)
)
this
)
@@ -786,50 +742,38 @@
)
)
(defmethod length collide-sticky-rider-group ((this collide-sticky-rider-group))
(defmethod length ((this collide-sticky-rider-group))
(-> this num-riders)
)
(defmethod asize-of collide-sticky-rider-group ((this collide-sticky-rider-group))
(defmethod asize-of ((this collide-sticky-rider-group))
(the-as int (+ (-> this type size) (* (+ (-> this allocated-riders) -1) 32)))
)
;;;;;;;;;;;;;;;;;;;;
;; Fake Meshes
;;;;;;;;;;;;;;;;;;;;
;; These aren't real meshes, but are returned when you collide with the background or water.
;; Background and water collision work differently, but this allows these systems to pretend to be
;; part of the old collision system.
(define *collide-shape-prim-backgnd*
(new 'static 'collide-shape-prim-mesh
:cshape #f
:prim-core
(new 'static 'collide-prim-core
:world-sphere (new 'static 'vector :w 204800000.0)
:collide-as (collide-kind background)
:action (collide-action solid)
:offense (collide-offense indestructible)
:prim-type 2
)
:local-sphere (new 'static 'vector :w 204800000.0)
:mesh #f
)
(define *collide-shape-prim-backgnd* (new 'static 'collide-shape-prim-mesh
:cshape #f
:prim-core (new 'static 'collide-prim-core
:world-sphere (new 'static 'vector :w 204800000.0)
:collide-as (collide-kind background)
:action (collide-action solid)
:offense (collide-offense indestructible)
:prim-type 2
)
:local-sphere (new 'static 'vector :w 204800000.0)
:mesh #f
)
)
(define *collide-shape-prim-water*
(new 'static 'collide-shape-prim-mesh
:cshape #f
:prim-core
(new 'static 'collide-prim-core
:world-sphere (new 'static 'vector :w 204800000.0)
:collide-as (collide-kind water)
:action (collide-action solid)
:offense (collide-offense indestructible)
:prim-type 2
)
:local-sphere (new 'static 'vector :w 204800000.0)
:mesh #f
)
(define *collide-shape-prim-water* (new 'static 'collide-shape-prim-mesh
:cshape #f
:prim-core (new 'static 'collide-prim-core
:world-sphere (new 'static 'vector :w 204800000.0)
:collide-as (collide-kind water)
:action (collide-action solid)
:offense (collide-offense indestructible)
:prim-type 2
)
:local-sphere (new 'static 'vector :w 204800000.0)
:mesh #f
)
)
@@ -7,7 +7,7 @@
;; DECOMP BEGINS
(defmethod on-platform collide-shape ((this collide-shape) (arg0 collide-shape) (arg1 collide-overlap-result))
(defmethod on-platform ((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)
@@ -39,12 +39,12 @@
)
(defmethod on-platform-test collide-shape-prim ((this collide-shape-prim) (arg0 collide-shape-prim) (arg1 collide-overlap-result) (arg2 float))
(defmethod on-platform-test ((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 ((this collide-shape-prim-group) (arg0 collide-shape-prim) (arg1 collide-overlap-result) (arg2 float))
(defmethod on-platform-test ((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 (-> this num-prims))
@@ -73,7 +73,7 @@
(none)
)
(defmethod on-platform-test collide-shape-prim-mesh ((this collide-shape-prim-mesh) (arg0 collide-shape-prim) (arg1 collide-overlap-result) (arg2 float))
(defmethod on-platform-test ((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
@@ -153,7 +153,7 @@
(none)
)
(defmethod add-rider! collide-sticky-rider-group ((this collide-sticky-rider-group) (arg0 process-drawable))
(defmethod add-rider! ((this collide-sticky-rider-group) (arg0 process-drawable))
"Add a rider to this platform."
(let ((gp-0 (the-as collide-sticky-rider #f)))
(cond
@@ -173,7 +173,7 @@
)
)
(defmethod detect-riders! collide-shape ((this collide-shape))
(defmethod detect-riders! ((this collide-shape))
"See who is riding us."
(let ((s5-0 (-> this riders)))
(when s5-0
@@ -373,7 +373,7 @@
)
)
(defmethod pull-riders! collide-shape ((this collide-shape))
(defmethod pull-riders! ((this collide-shape))
"Move our riders."
(let ((s5-0 (-> this riders)))
(when s5-0
@@ -408,7 +408,7 @@
)
)
(defmethod pull-rider! collide-shape ((this collide-shape) (arg0 pull-rider-info))
(defmethod pull-rider! ((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)
@@ -483,7 +483,7 @@
)
)
(defmethod alloc-riders collide-shape ((this collide-shape) (arg0 int))
(defmethod alloc-riders ((this collide-shape) (arg0 int))
(if (-> this riders)
(format 0 "ERROR: colide-shape::alloc-riders is being called multiple times!~%")
(set! (-> this riders) (new 'process 'collide-sticky-rider-group arg0))
+172 -178
View File
@@ -10,195 +10,189 @@
;; 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)
((intersect vector :inline :offset-assert 0)
(trans vector :inline :offset-assert 16)
(transv vector :inline :offset-assert 32)
(transv-out vector :inline :offset-assert 48)
(local-normal vector :inline :offset-assert 64)
(surface-normal vector :inline :offset-assert 80)
(time time-frame :offset-assert 96)
(status cshape-moving-flags :offset-assert 104)
(pat pat-surface :offset-assert 112)
(reaction-flag cshape-reaction-flags :offset-assert 116)
((intersect vector :inline)
(trans vector :inline)
(transv vector :inline)
(transv-out vector :inline)
(local-normal vector :inline)
(surface-normal vector :inline)
(time time-frame)
(status cshape-moving-flags)
(pat pat-surface)
(reaction-flag cshape-reaction-flags)
)
:method-count-assert 10
:size-assert #x78
:flag-assert #xa00000078
(:methods
(update! (_type_ collide-shape-moving vector vector vector) _type_ 9)
(update! (_type_ collide-shape-moving vector vector vector) _type_)
)
)
;; This is the collide shape for target (Jak).
;; It is complicated.
(deftype control-info (collide-shape-moving)
((unknown-vector00 vector :inline :offset 448)
(unknown-vector01 vector :inline :offset 464)
(unknown-vector02 vector :inline :offset 480)
(unknown-quaternion00 quaternion :inline :offset 496)
(unknown-quaternion01 quaternion :inline :offset 512)
(unknown-float00 float :offset 528)
(unknown-float01 float :offset 532)
(unknown-float02 float :offset 536)
(unknown-vector10 vector :inline :offset 544)
(unknown-vector11 vector :inline :offset 560)
(unknown-vector12 vector :inline :offset 576)
(unknown-vector13 vector :inline :offset 592)
(unknown-vector14 vector :inline :offset 608)
(unknown-vector15 vector :inline :offset 624)
(unknown-vector16 vector :inline :offset 640)
(unknown-dynamics00 dynamics :offset 656)
(unknown-surface00 surface :offset 660)
(unknown-surface01 surface :offset 664)
(unknown-cpad-info00 cpad-info :offset 668)
(unknown-float10 float :offset 672)
(unknown-float11 float :offset 676)
(unknown-float12 float :offset 680)
(unknown-float13 float :offset 684)
(unknown-vector20 vector :inline :offset 688)
(unknown-vector21 vector :inline :offset 704)
(unknown-vector22 vector :inline :offset 720)
(unknown-vector23 vector :inline :offset 736)
(unknown-vector-array00 vector 7 :inline :offset 752)
(unknown-vector30 vector :inline :offset 880)
(unknown-vector31 vector :inline :offset 896)
(unknown-float20 float :offset 912)
(unknown-float21 float :offset 916)
(unknown-dword00 uint64 :offset 920)
(unknown-matrix00 matrix :inline :offset 928)
(unknown-matrix01 matrix :inline :offset 992)
(unknown-matrix02 matrix :inline :offset 1056)
(unknown-qword00 uint128 :offset 1136)
(unknown-float30 float :offset 1140)
(unknown-vector40 vector :inline :offset 1152)
(unknown-float40 float :offset 1172)
(unknown-float41 float :offset 1176)
(unknown-int00 int32 :offset 1180)
(unknown-float50 float :offset 1168)
(unknown-vector50 vector :inline :offset 1184)
(unknown-vector51 vector :inline :offset 1200)
(unknown-vector52 vector :inline :offset 1216)
(unknown-vector53 vector :inline :offset 1232)
(last-known-safe-ground vector :inline :offset 1248)
(unknown-vector55 vector :inline :offset 1264)
(unknown-dword10 time-frame :offset 1280)
(unknown-dword11 time-frame :offset 1288)
(unknown-float60 float :offset 1300)
(unknown-float61 float :offset 1304)
(unknown-float62 float :offset 1308)
(unknown-float63 float :offset 1312)
(unknown-float64 float :offset 1316)
(unknown-dword20 time-frame :offset 1320)
(unknown-dword21 time-frame :offset 1328)
(unknown-dword-coverage int64 :offset 1336)
(unknown-float-coverage-0 float :offset 1344)
(unknown-float-coverage-1 float :offset 1348)
(unknown-float-coverage-2 float :offset 1352)
(unknown-u32-coverage-0 uint32 :offset 1356)
(unknown-vector-coverage-0 vector :inline :offset 1376)
(unknown-vector-coverage-1 vector :inline :offset 1392)
(unknown-vector-coverage-2 vector :inline :offset 1440)
(unknown-vector-coverage-3 vector :inline :offset 1472)
(unknown-vector60 vector :inline :offset 1456)
(unknown-vector61 vector :inline :offset 1504)
(unknown-float70 float :offset 1520)
(unknown-float71 float :offset 1524)
(unknown-vector70 vector :inline :offset 1536)
(unknown-vector71 vector :inline :offset 1552)
(unknown-vector72 vector :inline :offset 1568)
(unknown-vector73 vector :inline :offset 1584)
(unknown-handle00 handle :offset 1600)
(unknown-sphere-array00 collide-shape-prim-sphere 3 :offset 1608)
(unknown-sphere00 collide-shape-prim-sphere :offset 1632)
(unknown-sphere01 collide-shape-prim-sphere :offset 1636)
(unknown-sphere02 collide-shape-prim-sphere :offset 1640)
(unknown-int50 int32 :offset 1656)
(unknown-dword30 time-frame :offset 1664)
(unknown-dword31 time-frame :offset 1672)
(unknown-dword32 time-frame :offset 1680)
(unknown-dword33 time-frame :offset 1688)
(unknown-dword34 time-frame :offset 1696)
(unknown-dword35 time-frame :offset 1704)
(unknown-dword36 time-frame :offset 1712)
(unknown-float80 float :offset 1724)
(unknown-float81 float :offset 1728)
(unknown-float82 float :offset 1732)
(unknown-vector80 vector :inline :offset 1744)
(unknown-cspace00 cspace :inline :offset 1760)
(unknown-vector90 vector :inline :offset 1776)
(unknown-vector91 vector :inline :offset 1792)
(unknown-vector92 vector :inline :offset 1824)
(unknown-cspace10 cspace :inline :offset 1808)
(unknown-symbol00 symbol :offset 1840)
(unknown-float90 float :offset 1844)
(unknown-float91 float :offset 1848)
(unknown-vector-array10 vector 16 :inline :offset 1856)
(unknown-float100 float :offset 2112)
(unknown-int10 int32 :offset 2116)
(unknown-float110 float :offset 2120)
(unknown-vector100 vector :inline :offset 2128)
(unknown-vector101 vector :inline :offset 2144)
(unknown-dword40 time-frame :offset 2160)
(unknown-dword41 time-frame :offset 2168)
(unknown-handle10 handle :offset 2176)
(unknown-uint20 uint32 :offset 2184)
(unknown-spoolanim00 spool-anim :offset 2184)
(unknown-int20 int32 :offset 2184)
(unknown-symbol20 symbol :offset 2184)
(unknown-float120 float :offset 2184)
(unknown-int21 int32 :offset 2188)
(unknown-uint30 uint32 :offset 2188)
(unknown-float121 float :offset 2188)
(unknown-uint31 uint32 :offset 2192)
(unknown-int37 int32 :offset 2192)
(unknown-float122 float :offset 2196)
(unknown-float123 float :offset 2200)
(unknown-float124 float :offset 2204)
(unknown-vector102 vector :inline :offset 2224)
(unknown-vector103 vector :inline :offset 2240)
(unknown-quaternion02 quaternion :inline :offset 2256)
(unknown-quaternion03 quaternion :inline :offset 2272)
(unknown-smush00 smush-control :inline :offset 2288)
(unknown-vector110 vector :inline :offset 2320)
(unknown-vector111 vector :inline :offset 2336)
(unknown-symbol30 symbol :offset 2384)
(unknown-int31 uint32 :offset 2384)
(unknown-dword50 int64 :offset 2392)
(unknown-dword51 int64 :offset 2400)
(unknown-pointer00 pointer :offset 2416)
(unknown-symbol40 symbol :offset 2428)
(unknown-dword60 int64 :offset 2432)
(unknown-dword61 int64 :offset 2440)
(unknown-dword62 int64 :offset 2448)
(unknown-dword63 int64 :offset 2456)
(unknown-halfword00 int16 :offset 2488)
(history-length int16 :offset 2490)
(history-data collide-history 128 :inline :offset-assert 2496)
(unknown-float140 float :offset 18944)
(unknown-dword70 time-frame :offset 18952)
(unknown-int40 int32 :offset 18880)
(unknown-dword80 time-frame :offset 18888)
(unknown-dword81 time-frame :offset 18896)
(unknown-float130 float :offset 18904)
(unknown-float131 float :offset 18908)
(unknown-dword82 time-frame :offset 18912)
(unknown-vector120 vector :inline :offset 18928)
(unknown-float150 float :offset 18944)
(unknown-vector121 vector :inline :offset 18960)
(wall-pat pat-surface :offset 18976)
(unknown-soundid00 sound-id :offset 18980)
(unknown-float141 float :offset 18984)
(unknown-soundid01 sound-id :offset 18988)
(unknown-int34 int32 :offset 18992)
(unknown-int35 int32 :offset 18996)
(unknown-int36 int32 :offset 19000)
((unknown-vector00 vector :inline :offset 448)
(unknown-vector01 vector :inline :offset 464)
(unknown-vector02 vector :inline :offset 480)
(unknown-quaternion00 quaternion :inline :offset 496)
(unknown-quaternion01 quaternion :inline :offset 512)
(unknown-float00 float :offset 528)
(unknown-float01 float :offset 532)
(unknown-float02 float :offset 536)
(unknown-vector10 vector :inline :offset 544)
(unknown-vector11 vector :inline :offset 560)
(unknown-vector12 vector :inline :offset 576)
(unknown-vector13 vector :inline :offset 592)
(unknown-vector14 vector :inline :offset 608)
(unknown-vector15 vector :inline :offset 624)
(unknown-vector16 vector :inline :offset 640)
(unknown-dynamics00 dynamics :offset 656)
(unknown-surface00 surface :offset 660)
(unknown-surface01 surface :offset 664)
(unknown-cpad-info00 cpad-info :offset 668)
(unknown-float10 float :offset 672)
(unknown-float11 float :offset 676)
(unknown-float12 float :offset 680)
(unknown-float13 float :offset 684)
(unknown-vector20 vector :inline :offset 688)
(unknown-vector21 vector :inline :offset 704)
(unknown-vector22 vector :inline :offset 720)
(unknown-vector23 vector :inline :offset 736)
(unknown-vector-array00 vector 7 :inline :offset 752)
(unknown-vector30 vector :inline :offset 880)
(unknown-vector31 vector :inline :offset 896)
(unknown-float20 float :offset 912)
(unknown-float21 float :offset 916)
(unknown-dword00 uint64 :offset 920)
(unknown-matrix00 matrix :inline :offset 928)
(unknown-matrix01 matrix :inline :offset 992)
(unknown-matrix02 matrix :inline :offset 1056)
(unknown-qword00 uint128 :offset 1136)
(unknown-float30 float :offset 1140)
(unknown-vector40 vector :inline :offset 1152)
(unknown-float40 float :offset 1172)
(unknown-float41 float :offset 1176)
(unknown-int00 int32 :offset 1180)
(unknown-float50 float :offset 1168)
(unknown-vector50 vector :inline :offset 1184)
(unknown-vector51 vector :inline :offset 1200)
(unknown-vector52 vector :inline :offset 1216)
(unknown-vector53 vector :inline :offset 1232)
(last-known-safe-ground vector :inline :offset 1248)
(unknown-vector55 vector :inline :offset 1264)
(unknown-dword10 time-frame :offset 1280)
(unknown-dword11 time-frame :offset 1288)
(unknown-float60 float :offset 1300)
(unknown-float61 float :offset 1304)
(unknown-float62 float :offset 1308)
(unknown-float63 float :offset 1312)
(unknown-float64 float :offset 1316)
(unknown-dword20 time-frame :offset 1320)
(unknown-dword21 time-frame :offset 1328)
(unknown-dword-coverage int64 :offset 1336)
(unknown-float-coverage-0 float :offset 1344)
(unknown-float-coverage-1 float :offset 1348)
(unknown-float-coverage-2 float :offset 1352)
(unknown-u32-coverage-0 uint32 :offset 1356)
(unknown-vector-coverage-0 vector :inline :offset 1376)
(unknown-vector-coverage-1 vector :inline :offset 1392)
(unknown-vector-coverage-2 vector :inline :offset 1440)
(unknown-vector-coverage-3 vector :inline :offset 1472)
(unknown-vector60 vector :inline :offset 1456)
(unknown-vector61 vector :inline :offset 1504)
(unknown-float70 float :offset 1520)
(unknown-float71 float :offset 1524)
(unknown-vector70 vector :inline :offset 1536)
(unknown-vector71 vector :inline :offset 1552)
(unknown-vector72 vector :inline :offset 1568)
(unknown-vector73 vector :inline :offset 1584)
(unknown-handle00 handle :offset 1600)
(unknown-sphere-array00 collide-shape-prim-sphere 3 :offset 1608)
(unknown-sphere00 collide-shape-prim-sphere :offset 1632)
(unknown-sphere01 collide-shape-prim-sphere :offset 1636)
(unknown-sphere02 collide-shape-prim-sphere :offset 1640)
(unknown-int50 int32 :offset 1656)
(unknown-dword30 time-frame :offset 1664)
(unknown-dword31 time-frame :offset 1672)
(unknown-dword32 time-frame :offset 1680)
(unknown-dword33 time-frame :offset 1688)
(unknown-dword34 time-frame :offset 1696)
(unknown-dword35 time-frame :offset 1704)
(unknown-dword36 time-frame :offset 1712)
(unknown-float80 float :offset 1724)
(unknown-float81 float :offset 1728)
(unknown-float82 float :offset 1732)
(unknown-vector80 vector :inline :offset 1744)
(unknown-cspace00 cspace :inline :offset 1760)
(unknown-vector90 vector :inline :offset 1776)
(unknown-vector91 vector :inline :offset 1792)
(unknown-vector92 vector :inline :offset 1824)
(unknown-cspace10 cspace :inline :offset 1808)
(unknown-symbol00 symbol :offset 1840)
(unknown-float90 float :offset 1844)
(unknown-float91 float :offset 1848)
(unknown-vector-array10 vector 16 :inline :offset 1856)
(unknown-float100 float :offset 2112)
(unknown-int10 int32 :offset 2116)
(unknown-float110 float :offset 2120)
(unknown-vector100 vector :inline :offset 2128)
(unknown-vector101 vector :inline :offset 2144)
(unknown-dword40 time-frame :offset 2160)
(unknown-dword41 time-frame :offset 2168)
(unknown-handle10 handle :offset 2176)
(unknown-uint20 uint32 :offset 2184)
(unknown-spoolanim00 spool-anim :overlay-at unknown-uint20)
(unknown-int20 int32 :overlay-at unknown-spoolanim00)
(unknown-symbol20 symbol :overlay-at unknown-int20)
(unknown-float120 float :overlay-at unknown-symbol20)
(unknown-int21 int32 :offset 2188)
(unknown-uint30 uint32 :overlay-at unknown-int21)
(unknown-float121 float :overlay-at unknown-uint30)
(unknown-uint31 uint32 :offset 2192)
(unknown-int37 int32 :overlay-at unknown-uint31)
(unknown-float122 float :offset 2196)
(unknown-float123 float :offset 2200)
(unknown-float124 float :offset 2204)
(unknown-vector102 vector :inline :offset 2224)
(unknown-vector103 vector :inline :offset 2240)
(unknown-quaternion02 quaternion :inline :offset 2256)
(unknown-quaternion03 quaternion :inline :offset 2272)
(unknown-smush00 smush-control :inline :offset 2288)
(unknown-vector110 vector :inline :offset 2320)
(unknown-vector111 vector :inline :offset 2336)
(unknown-symbol30 symbol :offset 2384)
(unknown-int31 uint32 :overlay-at unknown-symbol30)
(unknown-dword50 int64 :offset 2392)
(unknown-dword51 int64 :offset 2400)
(unknown-pointer00 pointer :offset 2416)
(unknown-symbol40 symbol :offset 2428)
(unknown-dword60 int64 :offset 2432)
(unknown-dword61 int64 :offset 2440)
(unknown-dword62 int64 :offset 2448)
(unknown-dword63 int64 :offset 2456)
(unknown-halfword00 int16 :offset 2488)
(history-length int16 :offset 2490)
(history-data collide-history 128 :inline)
(unknown-float140 float :offset 18944)
(unknown-dword70 time-frame :offset 18952)
(unknown-int40 int32 :offset 18880)
(unknown-dword80 time-frame :offset 18888)
(unknown-dword81 time-frame :offset 18896)
(unknown-float130 float :offset 18904)
(unknown-float131 float :offset 18908)
(unknown-dword82 time-frame :offset 18912)
(unknown-vector120 vector :inline :offset 18928)
(unknown-float150 float :overlay-at unknown-float140)
(unknown-vector121 vector :inline :offset 18960)
(wall-pat pat-surface :offset 18976)
(unknown-soundid00 sound-id :offset 18980)
(unknown-float141 float :offset 18984)
(unknown-soundid01 sound-id :offset 18988)
(unknown-int34 int32 :offset 18992)
(unknown-int35 int32 :offset 18996)
(unknown-int36 int32 :offset 19000)
)
:method-count-assert 65
:size-assert #x4a3c
:flag-assert #x4100004a3c
)
(defmethod update! collide-history ((this collide-history) (cshape collide-shape-moving) (xs vector) (transv vector) (transv-out vector))
(defmethod update! ((this collide-history) (cshape collide-shape-moving) (xs vector) (transv vector) (transv-out vector))
"Update the collide-history element."
(set! (-> this intersect quad) (-> xs quad))
(set! (-> this transv quad) (-> transv quad))
+49 -61
View File
@@ -20,54 +20,47 @@
;; A record of a primitive which is touching another, possibly including the triangle that is involved.
(deftype touching-prim (structure)
((cprim collide-shape-prim :offset-assert 0)
(has-tri? symbol :offset-assert 4)
(tri collide-tri-result :inline :offset-assert 16)
((cprim collide-shape-prim)
(has-tri? symbol)
(tri collide-tri-result :inline)
)
:method-count-assert 9
:size-assert #x64
:flag-assert #x900000064
)
;; A record of two primitives which are touching.
(deftype touching-prims-entry (structure)
((next touching-prims-entry :offset-assert 0)
(prev touching-prims-entry :offset-assert 4)
(allocated? symbol :offset-assert 8)
(u float :offset-assert 12)
(prim1 touching-prim :inline :offset-assert 16)
(prim2 touching-prim :inline :offset-assert 128)
((next touching-prims-entry)
(prev touching-prims-entry)
(allocated? symbol)
(u float)
(prim1 touching-prim :inline)
(prim2 touching-prim :inline)
)
:method-count-assert 13
:size-assert #xe4
:flag-assert #xd000000e4
(:methods
(get-touched-prim (_type_ trsqv touching-shapes-entry) collide-shape-prim 9)
(touching-prims-entry-method-10 () none 10)
(get-middle-of-bsphere-overlap (_type_ vector) vector 11)
(get-touched-tri (_type_ collide-shape touching-shapes-entry) collide-tri-result 12)
(get-touched-prim (_type_ trsqv touching-shapes-entry) collide-shape-prim)
(touching-prims-entry-method-10 () none)
(get-middle-of-bsphere-overlap (_type_ vector) vector)
(get-touched-tri (_type_ collide-shape touching-shapes-entry) collide-tri-result)
)
)
;; A pool of up to 64 touching primitives. There is a linked list of freed entries.
(deftype touching-prims-entry-pool (structure)
((head touching-prims-entry :offset-assert 0)
(nodes touching-prims-entry 64 :inline :offset-assert 16)
((head touching-prims-entry)
(nodes touching-prims-entry 64 :inline)
)
:method-count-assert 13
:size-assert #x3c10
:flag-assert #xd00003c10
(:methods
(new (symbol type) _type_ 0)
(alloc-node (_type_) touching-prims-entry 9)
(get-free-node-count (_type_) int 10)
(init-list! (_type_) none 11)
(free-node (_type_ touching-prims-entry) touching-prims-entry 12)
(new (symbol type) _type_)
(alloc-node (_type_) touching-prims-entry)
(get-free-node-count (_type_) int)
(init-list! (_type_) none)
(free-node (_type_ touching-prims-entry) touching-prims-entry)
)
)
(defmethod init-list! touching-prims-entry-pool ((this touching-prims-entry-pool))
(defmethod init-list! ((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 (-> this nodes))))
@@ -104,48 +97,43 @@
)
)
;; two collide shapes which are touching.
;; This stores a list of primitive pairs which are touching.
(deftype touching-shapes-entry (structure)
((cshape1 collide-shape :offset-assert 0)
(cshape2 collide-shape :offset-assert 4)
(resolve-u int8 :offset-assert 8)
(head touching-prims-entry :offset-assert 12)
((cshape1 collide-shape)
(cshape2 collide-shape)
(resolve-u int8)
(head touching-prims-entry)
)
:allow-misaligned
:method-count-assert 18
:size-assert #x10
:flag-assert #x1200000010
(:methods
(touching-shapes-entry-method-9 (_type_) none 9)
(get-touched-shape (_type_ collide-shape) collide-shape 10)
(touching-shapes-entry-method-11 () none 11)
(prims-touching? (_type_ collide-shape-moving uint) touching-prims-entry 12)
(prims-touching-action? (_type_ collide-shape collide-action collide-action) touching-prims-entry 13)
(touching-shapes-entry-method-14 () none 14)
(free-touching-prims-list (_type_) symbol 15)
(get-head (_type_) touching-prims-entry 16)
(get-next (_type_ touching-prims-entry) touching-prims-entry 17)
(touching-shapes-entry-method-9 (_type_) none)
(get-touched-shape (_type_ collide-shape) collide-shape)
(touching-shapes-entry-method-11 () none)
(prims-touching? (_type_ collide-shape-moving uint) touching-prims-entry)
(prims-touching-action? (_type_ collide-shape collide-action collide-action) touching-prims-entry)
(touching-shapes-entry-method-14 () none)
(free-touching-prims-list (_type_) symbol)
(get-head (_type_) touching-prims-entry)
(get-next (_type_ touching-prims-entry) touching-prims-entry)
)
)
;; A list of (up to) TOUCHING_LIST_LENGTH pairs of colliding shapes
(deftype touching-list (structure)
((num-touching-shapes int32 :offset-assert 0)
(resolve-u int8 :offset-assert 4)
(touching-shapes touching-shapes-entry TOUCHING_LIST_LENGTH :inline :offset-assert 8)
((num-touching-shapes int32)
(resolve-u int8)
(touching-shapes touching-shapes-entry TOUCHING_LIST_LENGTH :inline)
)
:method-count-assert 15
:size-assert #x208
:flag-assert #xf00000208
(:methods
(new (symbol type) _type_ 0)
(add-touching-prims (_type_ collide-shape-prim collide-shape-prim float collide-tri-result collide-tri-result) none 9)
(touching-list-method-10 () none 10)
(update-from-step-size (_type_ float) none 11)
(send-events-for-touching-shapes (_type_) none 12)
(get-shapes-entry (_type_ collide-shape collide-shape) touching-shapes-entry 13)
(free-all-prim-nodes (_type_) none 14)
(new (symbol type) _type_)
(add-touching-prims (_type_ collide-shape-prim collide-shape-prim float collide-tri-result collide-tri-result) none)
(touching-list-method-10 () none)
(update-from-step-size (_type_ float) none)
(send-events-for-touching-shapes (_type_) none)
(get-shapes-entry (_type_ collide-shape collide-shape) touching-shapes-entry)
(free-all-prim-nodes (_type_) none)
)
)
@@ -165,11 +153,11 @@
)
)
(defmethod get-head touching-shapes-entry ((this touching-shapes-entry))
(defmethod get-head ((this touching-shapes-entry))
(-> this head)
)
(defmethod get-next touching-shapes-entry ((this touching-shapes-entry) (arg0 touching-prims-entry))
(defmethod get-next ((this touching-shapes-entry) (arg0 touching-prims-entry))
(-> arg0 next)
)
+15 -18
View File
@@ -24,7 +24,7 @@
;; there's a global shared pool of entries that you can alloc and free from.
(defmethod get-free-node-count touching-prims-entry-pool ((this touching-prims-entry-pool))
(defmethod get-free-node-count ((this touching-prims-entry-pool))
"Get the number of nodes that are not in use."
(let ((v0-0 0))
(let ((v1-0 (-> this head)))
@@ -40,7 +40,7 @@
)
)
(defmethod alloc-node touching-prims-entry-pool ((this touching-prims-entry-pool))
(defmethod alloc-node ((this touching-prims-entry-pool))
"Allocate a node. Will return #f if there are none left."
(let ((gp-0 (-> this head)))
(cond
@@ -63,7 +63,7 @@
)
)
(defmethod free-node touching-prims-entry-pool ((this touching-prims-entry-pool) (arg0 touching-prims-entry))
(defmethod free-node ((this touching-prims-entry-pool) (arg0 touching-prims-entry))
"Free a node allocated with alloc-node"
(when (-> arg0 allocated?)
(set! (-> arg0 allocated?) #f)
@@ -85,7 +85,7 @@
;; 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 ((this touching-shapes-entry))
(defmethod free-touching-prims-list ((this touching-shapes-entry))
"Return all nodes used by this touching-shapes-entry to the touching-prims-entry-pool"
(when (-> this cshape1)
(set! (-> this cshape1) #f)
@@ -112,7 +112,7 @@
;; A touching list is a list up to TOUCHING_LIST_LENGTH pairs of colliding collide-shapes.
(defmethod free-all-prim-nodes touching-list ((this touching-list))
(defmethod free-all-prim-nodes ((this touching-list))
"Free all prim nodes used by all touching shapes in this touching-list."
(let ((s5-0 (the-as touching-shapes-entry (-> this touching-shapes))))
(countdown (s4-0 (-> this num-touching-shapes))
@@ -127,7 +127,7 @@
)
(defmethod get-shapes-entry touching-list ((this touching-list) (arg0 collide-shape) (arg1 collide-shape))
(defmethod get-shapes-entry ((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 (-> this touching-shapes)))) ;; the candidate
(let ((v1-0 (the-as touching-shapes-entry #f))) ;; a good one
@@ -184,12 +184,9 @@
)
(deftype add-prims-touching-work (structure)
((tri1 collide-tri-result :offset-assert 0)
(tri2 collide-tri-result :offset-assert 4)
((tri1 collide-tri-result)
(tri2 collide-tri-result)
)
:method-count-assert 9
:size-assert #x8
:flag-assert #x900000008
)
@@ -211,7 +208,7 @@
(defmethod add-touching-prims touching-list ((this touching-list)
(defmethod add-touching-prims ((this touching-list)
(arg0 collide-shape-prim)
(arg1 collide-shape-prim)
(arg2 float)
@@ -346,7 +343,7 @@
(none)
)
(defmethod update-from-step-size touching-list ((this touching-list) (arg0 float))
(defmethod update-from-step-size ((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? (-> this resolve-u))
@@ -424,7 +421,7 @@
(none)
)
(defmethod send-events-for-touching-shapes touching-list ((this touching-list))
(defmethod send-events-for-touching-shapes ((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)"
@@ -575,7 +572,7 @@
(the-as touching-prims-entry #f)
)
(defmethod get-touched-shape touching-shapes-entry ((this touching-shapes-entry) (arg0 collide-shape))
(defmethod get-touched-shape ((this touching-shapes-entry) (arg0 collide-shape))
"Get the other shape in a pair of shapes."
(cond
((= (-> this cshape1) arg0)
@@ -588,7 +585,7 @@
(the-as collide-shape #f)
)
(defmethod get-touched-prim touching-prims-entry ((this touching-prims-entry) (arg0 trsqv) (arg1 touching-shapes-entry))
(defmethod get-touched-prim ((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)
@@ -601,7 +598,7 @@
(the-as collide-shape-prim #f)
)
(defmethod get-touched-tri touching-prims-entry ((this touching-prims-entry) (arg0 collide-shape) (arg1 touching-shapes-entry))
(defmethod get-touched-tri ((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
@@ -624,7 +621,7 @@
)
)
(defmethod get-middle-of-bsphere-overlap touching-prims-entry ((this touching-prims-entry) (arg0 vector))
(defmethod get-middle-of-bsphere-overlap ((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."
+40 -47
View File
@@ -56,22 +56,17 @@
;; 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
(material pat-material :offset 6 :size 6) ;; material for effects (sound, particles, surfaces...)
(camera uint8 :offset 12 :size 2) ;; 2 bits for camera (used later)
(event pat-event :offset 14 :size 6) ;; what happens if we hit this?
(noentity uint8 :offset 0 :size 1) ;; collisions for actors/jak/etc ignore this
(nocamera uint8 :offset 1 :size 1) ;; collisions for camera ignore this
(noedge uint8 :offset 2 :size 1) ;; seems unused? maybe no edge grab?
(nolineofsight uint8 :offset 12 :size 1) ;; camera don't worry about this object blocking line-of-sight to jak.
;; 13 belongs to "camera", but seems unsed.
;; 14 is unused?
(unknown-bit uint8 :offset 15 :size 1) ;; maybe death plane?
((skip uint8 :offset 0 :size 3)
(mode pat-mode :offset 3 :size 3)
(material pat-material :offset 6 :size 6)
(camera uint8 :offset 12 :size 2)
(event pat-event :offset 14 :size 6)
(noentity uint8 :offset 0 :size 1)
(nocamera uint8 :offset 1 :size 1)
(noedge uint8 :offset 2 :size 1)
(nolineofsight uint8 :offset 12 :size 1)
(unknown-bit uint8 :offset 15 :size 1)
)
:method-count-assert 9
:size-assert #x4
:flag-assert #x900000004
)
(defun-debug pat-material->string ((pat pat-surface))
@@ -88,40 +83,38 @@
;; for debug drawing pat's by mode.
(deftype pat-mode-info (structure)
((name string :offset-assert 0)
(wall-angle float :offset-assert 4)
(color rgba :offset-assert 8)
(hilite-color rgba :offset-assert 12)
((name string)
(wall-angle float)
(color rgba)
(hilite-color rgba)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
(define *pat-mode-info* (new 'static 'inline-array pat-mode-info 4
(new 'static 'pat-mode-info
:name "ground"
:wall-angle 0.2
:color (new 'static 'rgba :r #x7f :a #x40)
:hilite-color (new 'static 'rgba :r #xff :a #x80)
(new 'static 'pat-mode-info
:name "ground"
:wall-angle 0.2
:color (new 'static 'rgba :r #x7f :a #x40)
:hilite-color (new 'static 'rgba :r #xff :a #x80)
)
(new 'static 'pat-mode-info
:name "wall"
:wall-angle 2.0
:color (new 'static 'rgba :b #x7f :a #x40)
:hilite-color (new 'static 'rgba :b #xff :a #x80)
)
(new 'static 'pat-mode-info
:name "obstacle"
:wall-angle 0.82
:color (new 'static 'rgba :r #x7f :b #x7f :a #x40)
:hilite-color (new 'static 'rgba :r #xff :b #xff :a #x80)
)
(new 'static 'pat-mode-info
:name "pole"
:wall-angle 2.0
:color (new 'static 'rgba :r #x7f :g #x7f :a #x40)
:hilite-color (new 'static 'rgba :r #xff :g #xff :a #x80)
)
)
)
(new 'static 'pat-mode-info
:name "wall"
:wall-angle 2.0
:color (new 'static 'rgba :b #x7f :a #x40)
:hilite-color (new 'static 'rgba :b #xff :a #x80)
)
(new 'static 'pat-mode-info
:name "obstacle"
:wall-angle 0.82
:color (new 'static 'rgba :r #x7f :b #x7f :a #x40)
:hilite-color (new 'static 'rgba :r #xff :b #xff :a #x80)
)
(new 'static 'pat-mode-info
:name "pole"
:wall-angle 2.0
:color (new 'static 'rgba :r #x7f :g #x7f :a #x40)
:hilite-color (new 'static 'rgba :r #xff :g #xff :a #x80)
)
)
)
+33 -37
View File
@@ -51,43 +51,39 @@
;; Note that "surface" can apply to weird things, like riding the zoomer or swimming as well.
(deftype surface (basic)
((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)
((name symbol)
(turnv float)
(turnvv float)
(tiltv float)
(tiltvv float)
(transv-max float)
(target-speed float)
(seek0 float)
(seek90 float)
(seek180 float)
(fric float)
(nonlin-fric-dist float)
(slip-factor float)
(slide-factor float)
(slope-up-factor float)
(slope-down-factor float)
(slope-slip-angle float)
(impact-fric float)
(bend-factor float)
(bend-speed float)
(alignv float)
(slope-up-traction float)
(align-speed float)
(active-hook (function none) :offset 128)
(touch-hook (function none))
(impact-hook function)
(mult-hook (function surface surface surface int none))
(mode symbol)
(flags surface-flags)
(data float 30 :overlay-at turnv)
(hook function 4 :overlay-at active-hook)
(dataw uint32 2 :overlay-at mode)
)
:method-count-assert 9
:size-assert #x98
:flag-assert #x900000098
)
;; these calc-terminal functions are unused.
@@ -107,7 +103,7 @@
)
)
(defmethod print surface ((this surface))
(defmethod print ((this surface))
;; seems this format string is wrong.
(format
#t
+3 -7
View File
@@ -9,10 +9,6 @@
(deftype babak (nav-enemy)
()
:heap-base #x120
:method-count-assert 76
:size-assert #x190
:flag-assert #x4c01200190
(:states
babak-run-to-cannon
)
@@ -239,7 +235,7 @@
)
)
(defmethod initialize-collision babak ((this babak))
(defmethod initialize-collision ((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)
@@ -286,7 +282,7 @@
(none)
)
(defmethod nav-enemy-method-48 babak ((this babak))
(defmethod nav-enemy-method-48 ((this babak))
(initialize-skeleton this *babak-sg* '())
(init-defaults! this *babak-nav-enemy-info*)
(set! (-> this neck up) (the-as uint 0))
@@ -296,7 +292,7 @@
(none)
)
(defmethod nav-enemy-method-59 babak ((this babak))
(defmethod nav-enemy-method-59 ((this babak))
(cond
((and (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete)))
(logtest? (-> this enemy-info options) (fact-options has-power-cell))
+61 -67
View File
@@ -9,38 +9,36 @@
;; DECOMP BEGINS
(deftype basebutton (process-drawable)
((root-override collide-shape-moving :offset 112)
(down? symbol :offset-assert 176)
(spawned-by-other? symbol :offset-assert 180)
(move-to? symbol :offset-assert 184)
(notify-actor entity-actor :offset-assert 188)
(timeout float :offset-assert 192)
(button-id int32 :offset-assert 196)
(event-going-down symbol :offset-assert 200)
(event-down symbol :offset-assert 204)
(event-going-up symbol :offset-assert 208)
(event-up symbol :offset-assert 212)
(anim-speed float :offset-assert 216)
(move-to-pos vector :inline :offset-assert 224)
(move-to-quat quaternion :inline :offset-assert 240)
((root collide-shape-moving :override)
(down? symbol)
(spawned-by-other? symbol)
(move-to? symbol)
(notify-actor entity-actor)
(timeout float)
(button-id int32)
(event-going-down symbol)
(event-down symbol)
(event-going-up symbol)
(event-up symbol)
(anim-speed float)
(move-to-pos vector :inline)
(move-to-quat quaternion :inline)
)
:heap-base #x90
:method-count-assert 32
:size-assert #x100
:flag-assert #x2000900100
(:state-methods
basebutton-down-idle
basebutton-going-down
basebutton-going-up
basebutton-startup
basebutton-up-idle
)
(:methods
(basebutton-down-idle () _type_ :state 20)
(basebutton-going-down () _type_ :state 21)
(basebutton-going-up () _type_ :state 22)
(basebutton-startup () _type_ :state 23)
(basebutton-up-idle () _type_ :state 24)
(reset! (_type_) float 25)
(basebutton-method-26 (_type_) none 26)
(basebutton-method-27 (_type_) collide-shape-moving 27)
(arm-trigger-event! (_type_) symbol 28)
(basebutton-method-29 (_type_ symbol entity) none 29)
(move-to-vec-or-quat! (_type_ vector quaternion) quaternion 30)
(press! (_type_ symbol) int 31)
(reset! (_type_) float)
(basebutton-method-26 (_type_) none)
(basebutton-method-27 (_type_) collide-shape-moving)
(arm-trigger-event! (_type_) symbol)
(basebutton-method-29 (_type_ symbol entity) none)
(move-to-vec-or-quat! (_type_ vector quaternion) quaternion)
(press! (_type_ symbol) int)
)
)
@@ -50,15 +48,15 @@
:bounds (static-spherem 0 0 0 3)
)
(defmethod move-to-vec-or-quat! basebutton ((this basebutton) (arg0 vector) (arg1 quaternion))
(defmethod move-to-vec-or-quat! ((this basebutton) (arg0 vector) (arg1 quaternion))
(set! (-> this move-to?) #t)
(if arg0
(set! (-> this move-to-pos quad) (-> arg0 quad))
(set! (-> this move-to-pos quad) (-> this root-override trans quad))
(set! (-> this move-to-pos quad) (-> this root trans quad))
)
(if arg1
(quaternion-copy! (-> this move-to-quat) arg1)
(quaternion-copy! (-> this move-to-quat) (-> this root-override quat))
(quaternion-copy! (-> this move-to-quat) (-> this root quat))
)
)
@@ -106,8 +104,8 @@
:post (behavior ()
(when (-> self move-to?)
(set! (-> self move-to?) #f)
(set! (-> self root-override trans quad) (-> self move-to-pos quad))
(quaternion-copy! (-> self root-override quat) (-> self move-to-quat))
(set! (-> self root trans quad) (-> self move-to-pos quad))
(quaternion-copy! (-> self root quat) (-> self move-to-quat))
(rider-post)
)
)
@@ -142,8 +140,8 @@
:post (behavior ()
(when (-> self move-to?)
(set! (-> self move-to?) #f)
(set! (-> self root-override trans quad) (-> self move-to-pos quad))
(quaternion-copy! (-> self root-override quat) (-> self move-to-quat))
(set! (-> self root trans quad) (-> self move-to-pos quad))
(quaternion-copy! (-> self root quat) (-> self move-to-quat))
)
(rider-post)
)
@@ -189,8 +187,8 @@
:post (behavior ()
(when (-> self move-to?)
(set! (-> self move-to?) #f)
(set! (-> self root-override trans quad) (-> self move-to-pos quad))
(quaternion-copy! (-> self root-override quat) (-> self move-to-quat))
(set! (-> self root trans quad) (-> self move-to-pos quad))
(quaternion-copy! (-> self root quat) (-> self move-to-quat))
(rider-post)
)
)
@@ -225,14 +223,14 @@
:post (behavior ()
(when (-> self move-to?)
(set! (-> self move-to?) #f)
(set! (-> self root-override trans quad) (-> self move-to-pos quad))
(quaternion-copy! (-> self root-override quat) (-> self move-to-quat))
(set! (-> self root trans quad) (-> self move-to-pos quad))
(quaternion-copy! (-> self root quat) (-> self move-to-quat))
)
(rider-post)
)
)
(defmethod press! basebutton ((this basebutton) (arg0 symbol))
(defmethod press! ((this basebutton) (arg0 symbol))
(set! (-> this down?) arg0)
(cond
(arg0
@@ -248,7 +246,7 @@
)
)
(defmethod basebutton-method-29 basebutton ((this basebutton) (arg0 symbol) (arg1 entity))
(defmethod basebutton-method-29 ((this basebutton) (arg0 symbol) (arg1 entity))
(with-pp
(when arg0
(cond
@@ -278,7 +276,7 @@
)
)
(defmethod reset! basebutton ((this basebutton))
(defmethod reset! ((this basebutton))
(set! (-> this down?) #f)
(set! (-> this spawned-by-other?) #t)
(set! (-> this move-to?) #f)
@@ -291,14 +289,14 @@
(set! (-> this anim-speed) 1.0)
)
(defmethod arm-trigger-event! basebutton ((this basebutton))
(defmethod arm-trigger-event! ((this basebutton))
(let ((v0-0 'trigger))
(set! (-> this event-going-down) v0-0)
v0-0
)
)
(defmethod basebutton-method-26 basebutton ((this basebutton))
(defmethod basebutton-method-26 ((this basebutton))
(initialize-skeleton this *generic-button-sg* '())
(logior! (-> this skel status) (janim-status inited))
(ja-channel-set! 1)
@@ -327,12 +325,12 @@
)
)
(set! (-> this anim-speed) 2.0)
(update-transforms! (-> this root-override))
(update-transforms! (-> this root))
(ja-post)
(none)
)
(defmethod basebutton-method-27 basebutton ((this basebutton))
(defmethod basebutton-method-27 ((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)
@@ -367,12 +365,12 @@
)
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
(backup-collide-with-as s5-0)
(set! (-> this root-override) s5-0)
(set! (-> this root) s5-0)
s5-0
)
)
(defmethod init-from-entity! basebutton ((this basebutton) (arg0 entity-actor))
(defmethod init-from-entity! ((this basebutton) (arg0 entity-actor))
(reset! this)
(set! (-> this spawned-by-other?) #f)
(set! (-> this button-id) -1)
@@ -398,7 +396,7 @@
(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))
(nav-mesh-connect this (-> this root) (the-as nav-control #f))
)
(arm-trigger-event! this)
(basebutton-method-26 this)
@@ -417,9 +415,9 @@
(set! (-> self entity) arg0)
)
(basebutton-method-27 self)
(set! (-> self root-override trans quad) (-> arg1 quad))
(quaternion-copy! (-> self root-override quat) arg2)
(set-vector! (-> self root-override scale) 1.0 1.0 1.0 1.0)
(set! (-> self root trans quad) (-> arg1 quad))
(quaternion-copy! (-> self root quat) arg2)
(set-vector! (-> self root scale) 1.0 1.0 1.0 1.0)
(arm-trigger-event! self)
(basebutton-method-26 self)
(go-virtual basebutton-startup)
@@ -436,20 +434,16 @@
)
(deftype warp-gate (process-drawable)
((level symbol :offset-assert 176)
(level-slot int32 :offset-assert 180)
(min-slot int32 :offset-assert 184)
(max-slot int32 :offset-assert 188)
((level symbol)
(level-slot int32)
(min-slot int32)
(max-slot int32)
)
:heap-base #x50
:method-count-assert 24
:size-assert #xc0
:flag-assert #x18005000c0
(:methods
(idle () _type_ :state 20)
(active () _type_ :state 21)
(use (int level) _type_ :state 22)
(hidden () _type_ :state 23)
(:state-methods
idle
active
(use int level)
hidden
)
)
+60 -68
View File
@@ -45,36 +45,32 @@
;; DECOMP BEGINS
(deftype baseplat (process-drawable)
((root-override collide-shape-moving :offset 112)
(smush smush-control :inline :offset-assert 176)
(basetrans vector :inline :offset-assert 208)
(bouncing symbol :offset-assert 224)
((root collide-shape-moving :override)
(smush smush-control :inline)
(basetrans vector :inline)
(bouncing symbol)
)
:heap-base #x80
:method-count-assert 27
:size-assert #xe4
:flag-assert #x1b008000e4
(:methods
(baseplat-method-20 (_type_) none 20)
(baseplat-method-21 (_type_) none 21)
(baseplat-method-22 (_type_) none 22)
(get-unlit-skel (_type_) skeleton-group 23)
(baseplat-method-24 (_type_) none 24)
(baseplat-method-25 (_type_) sparticle-launch-group 25)
(baseplat-method-26 (_type_) none 26)
(baseplat-method-20 (_type_) none)
(baseplat-method-21 (_type_) none)
(baseplat-method-22 (_type_) none)
(get-unlit-skel (_type_) skeleton-group)
(baseplat-method-24 (_type_) none)
(baseplat-method-25 (_type_) sparticle-launch-group)
(baseplat-method-26 (_type_) none)
)
)
(defmethod baseplat-method-21 baseplat ((this baseplat))
(defmethod baseplat-method-21 ((this baseplat))
(logior! (-> this skel status) (janim-status inited))
(set! (-> this basetrans quad) (-> this root-override trans quad))
(set! (-> this basetrans quad) (-> this root trans quad))
(set! (-> this bouncing) #f)
0
(none)
)
(defmethod baseplat-method-22 baseplat ((this baseplat))
(defmethod baseplat-method-22 ((this baseplat))
(activate! (-> this smush) -1.0 60 150 1.0 1.0)
(set! (-> this bouncing) #t)
(logclear! (-> this mask) (process-mask sleep))
@@ -108,14 +104,14 @@
(let ((gp-0 (new 'stack-no-clear 'vector)))
(set! (-> gp-0 quad) (-> self basetrans quad))
(+! (-> gp-0 y) (* 819.2 (update! (-> self smush))))
(move-to-point! (-> self root-override) gp-0)
(move-to-point! (-> self root) gp-0)
)
(if (not (!= (-> self smush amp) 0.0))
(set! (-> self bouncing) #f)
)
)
(else
(move-to-point! (-> self root-override) (-> self basetrans))
(move-to-point! (-> self root) (-> self basetrans))
)
)
(none)
@@ -127,13 +123,13 @@
(none)
)
(defmethod baseplat-method-25 baseplat ((this baseplat))
(defmethod baseplat-method-25 ((this baseplat))
(the-as sparticle-launch-group 0)
)
(defmethod baseplat-method-20 baseplat ((this baseplat))
(defmethod baseplat-method-20 ((this baseplat))
(if (nonzero? (-> this part))
(spawn (-> this part) (-> this root-override trans))
(spawn (-> this part) (-> this root trans))
)
(none)
)
@@ -147,31 +143,29 @@
)
(deftype eco-door (process-drawable)
((root-override collide-shape :offset 112)
(speed float :offset-assert 176)
(open-distance float :offset-assert 180)
(close-distance float :offset-assert 184)
(out-dir vector :inline :offset-assert 192)
(open-sound sound-name :offset-assert 208)
(close-sound sound-name :offset-assert 224)
(state-actor entity-actor :offset-assert 240)
(flags eco-door-flags :offset-assert 244)
(locked symbol :offset-assert 248)
(auto-close symbol :offset-assert 252)
(one-way symbol :offset-assert 256)
((root collide-shape :override)
(speed float)
(open-distance float)
(close-distance float)
(out-dir vector :inline)
(open-sound sound-name)
(close-sound sound-name)
(state-actor entity-actor)
(flags eco-door-flags)
(locked symbol)
(auto-close symbol)
(one-way symbol)
)
:heap-base #xa0
:method-count-assert 27
:size-assert #x104
:flag-assert #x1b00a00104
(:state-methods
door-closed
door-opening
door-open
door-closing
)
(:methods
(door-closed () _type_ :state 20)
(door-opening () _type_ :state 21)
(door-open () _type_ :state 22)
(door-closing () _type_ :state 23)
(eco-door-method-24 (_type_) none 24)
(eco-door-method-25 (_type_) none 25)
(eco-door-method-26 (_type_) none 26)
(eco-door-method-24 (_type_) none)
(eco-door-method-25 (_type_) none)
(eco-door-method-26 (_type_) none)
)
)
@@ -203,12 +197,11 @@ eco-door-event-handler
:code (behavior ()
(ja :num-func num-func-identity :frame-num 0.0)
(suspend)
(update-transforms! (-> self root-override))
(update-transforms! (-> self root))
(ja-post)
(loop
(when (and *target* (>= (-> self open-distance)
(vector-vector-distance (-> self root-override trans) (-> *target* control trans))
)
(when (and *target*
(>= (-> self open-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans)))
)
(eco-door-method-26 self)
(if (and (not (-> self locked))
@@ -237,10 +230,10 @@ eco-door-event-handler
)
)
(if gp-0
(sound-play "blue-eco-on" :position (the-as symbol (-> self root-override trans)))
(sound-play "blue-eco-on" :position (the-as symbol (-> self root trans)))
)
(sound-play-by-name (-> self open-sound) (new-sound-id) 1024 0 0 (sound-group sfx) #t)
(clear-collide-with-as (-> self root-override))
(clear-collide-with-as (-> self root))
(until (ja-done? 0)
(ja :num! (seek! max (-> self speed)))
(if (and gp-0 (rand-vu-percent? 0.5))
@@ -260,20 +253,19 @@ eco-door-event-handler
:code (behavior ()
(set-time! (-> self state-time))
(process-entity-status! self (entity-perm-status complete) #t)
(clear-collide-with-as (-> self root-override))
(clear-collide-with-as (-> self root))
(ja :num-func num-func-identity :frame-num max)
(logior! (-> self draw status) (draw-status hidden))
(suspend)
(update-transforms! (-> self root-override))
(update-transforms! (-> self root))
(ja-post)
(loop
(let ((f30-0 (vector4-dot (-> self out-dir) (target-pos 0)))
(f28-0 (vector4-dot (-> self out-dir) (camera-pos)))
)
(when (and (-> self auto-close)
(or (not *target*) (< (-> self close-distance)
(vector-vector-distance (-> self root-override trans) (-> *target* control trans))
)
(or (not *target*)
(< (-> self close-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans)))
)
)
(if (and (>= (* f30-0 f28-0) 0.0) (< 16384.0 (fabs f28-0)))
@@ -290,12 +282,12 @@ eco-door-event-handler
:virtual #t
:event eco-door-event-handler
:code (behavior ()
(restore-collide-with-as (-> self root-override))
(restore-collide-with-as (-> self root))
(logclear! (-> self draw status) (draw-status hidden))
(let ((gp-0 (new 'stack 'overlaps-others-params)))
(set! (-> gp-0 options) (the-as uint 1))
(set! (-> gp-0 tlist) #f)
(while (find-overlapping-shapes (-> self root-override) gp-0)
(while (find-overlapping-shapes (-> self root) gp-0)
(suspend)
)
)
@@ -312,7 +304,7 @@ eco-door-event-handler
:post transform-post
)
(defmethod eco-door-method-26 eco-door ((this eco-door))
(defmethod eco-door-method-26 ((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)))
@@ -323,7 +315,7 @@ eco-door-event-handler
(none)
)
(defmethod eco-door-method-24 eco-door ((this eco-door))
(defmethod eco-door-method-24 ((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))
@@ -336,22 +328,22 @@ 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! (-> this root-override) s5-0)
(set! (-> this root) s5-0)
)
0
(none)
)
(defmethod eco-door-method-25 eco-door ((this eco-door))
(defmethod eco-door-method-25 ((this eco-door))
0
(none)
)
(defmethod init-from-entity! eco-door ((this eco-door) (arg0 entity-actor))
(defmethod init-from-entity! ((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-vector! (-> this root scale) f0-0 f0-0 f0-0 1.0)
)
(set! (-> this open-distance) 32768.0)
(set! (-> this close-distance) 49152.0)
@@ -367,9 +359,9 @@ eco-door-event-handler
(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))
(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))
(eco-door-method-25 this)
(if (and (not (-> this auto-close))
(-> this entity)
File diff suppressed because it is too large Load Diff
+74 -104
View File
@@ -50,13 +50,10 @@
)
(deftype crate-bank (basic)
((COLLIDE_YOFF float :offset-assert 4)
(COLLIDE_RADIUS float :offset-assert 8)
(DARKECO_EXPLODE_RADIUS float :offset-assert 12)
((COLLIDE_YOFF float)
(COLLIDE_RADIUS float)
(DARKECO_EXPLODE_RADIUS float)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
@@ -65,31 +62,29 @@
)
(deftype crate (process-drawable)
((root-override collide-shape-moving :offset 112)
(smush smush-control :inline :offset-assert 176)
(base vector :inline :offset-assert 208)
(look symbol :offset-assert 224)
(defense symbol :offset-assert 228)
(incomming-attack-id uint64 :offset-assert 232)
(target handle :offset-assert 240)
(child-count int32 :offset-assert 248)
(victory-anim spool-anim :offset-assert 252)
((root collide-shape-moving :override)
(smush smush-control :inline)
(base vector :inline)
(look symbol)
(defense symbol)
(incomming-attack-id uint64)
(target handle)
(child-count int32)
(victory-anim spool-anim)
)
:heap-base #x90
:method-count-assert 30
:size-assert #x100
:flag-assert #x1e00900100
(:state-methods
wait
(die symbol int)
special-contents-die
bounce-on
(notice-blue handle)
)
(:methods
(wait () _type_ :state 20)
(die (symbol int) _type_ :state 21)
(special-contents-die () _type_ :state 22)
(bounce-on () _type_ :state 23)
(notice-blue (handle) _type_ :state 24)
(params-init (_type_ entity) none 25)
(art-init (_type_) crate 26)
(params-set! (_type_ symbol symbol) none 27)
(check-dead (_type_) none 28)
(smush-update! (_type_) none 29)
(params-init (_type_ entity) none)
(art-init (_type_) crate)
(params-set! (_type_ symbol symbol) none)
(check-dead (_type_) none)
(smush-update! (_type_) none)
)
)
@@ -494,7 +489,7 @@
(go-virtual die #f (the-as int s5-0))
)
(else
(when (and (!= s4-0 (-> self incomming-attack-id)) (= (-> self root-override trans y) (-> self base y)))
(when (and (!= s4-0 (-> self incomming-attack-id)) (= (-> self root trans y) (-> self base y)))
(if (not (and (!= *kernel-boot-message* 'play) (= (-> *setting-control* current language) (language-enum japanese)))
)
(level-hint-spawn (text-id training-ironcrate) "sagevb36" (the-as entity #f) *entity-pool* (game-task none))
@@ -548,7 +543,7 @@
(go-virtual die #f (the-as int s5-0))
)
(else
(when (and (!= s4-0 (-> self incomming-attack-id)) (= (-> self root-override trans y) (-> self base y)))
(when (and (!= s4-0 (-> self incomming-attack-id)) (= (-> self root trans y) (-> self base y)))
(level-hint-spawn
(text-id sidekick-hint-crate-steel)
"sksp0006"
@@ -630,7 +625,7 @@
)
)
(('bonk)
(when (= (-> self root-override trans y) (-> self base y))
(when (= (-> self root trans y) (-> self base y))
(activate! (-> self smush) -0.1 75 150 1.0 1.0)
(go-virtual bounce-on)
)
@@ -644,7 +639,7 @@
(('eco-blue)
(if (not (or (= (-> self defense) 'darkeco)
(or (= (-> self next-state name) 'notice-blue) (= (-> self next-state name) 'die))
(!= (-> self root-override trans y) (-> self base y))
(!= (-> self root trans y) (-> self base y))
)
)
(go-virtual notice-blue (process->handle arg0))
@@ -658,7 +653,7 @@
:event crate-standard-event-handler
:code (behavior ()
(suspend)
(update-transforms! (-> self root-override))
(update-transforms! (-> self root))
(logior! (-> self mask) (process-mask sleep))
(loop
(suspend)
@@ -712,7 +707,7 @@
)
)
(when v1-6
(let* ((gp-2 (-> self root-override root-prim prim-core))
(let* ((gp-2 (-> self root root-prim prim-core))
(a1-3 (-> (the-as collide-shape v1-6) root-prim prim-core))
(f30-0 (vector-vector-distance (the-as vector gp-2) (the-as vector a1-3)))
)
@@ -789,14 +784,14 @@
:trans (behavior ()
(case (-> self type)
((crate-buzzer)
(if (and *target* (>= (-> *target* fact-info-target buzzer) 6.0))
(if (and *target* (>= (-> *target* fact buzzer) 6.0))
(spool-push *art-control* (-> self victory-anim name) 0 self -99.0)
)
)
)
)
:code (behavior ((arg0 symbol) (arg1 int))
(clear-collide-with-as (-> self root-override))
(clear-collide-with-as (-> self root))
(if (nonzero? (-> self sound))
(stop! (-> self sound))
)
@@ -831,16 +826,13 @@
)
(case (-> self defense)
(('darkeco)
(let ((f0-0
(lerp-scale 1.0 0.0 (vector-vector-distance (-> self root-override trans) (target-pos 0)) 8192.0 40960.0)
)
)
(let ((f0-0 (lerp-scale 1.0 0.0 (vector-vector-distance (-> self root trans) (target-pos 0)) 8192.0 40960.0)))
(cpad-set-buzz! (-> *cpad-list* cpads 0) 1 (the int (* 255.0 f0-0)) (seconds 0.3))
)
(process-spawn
touch-tracker
:init touch-tracker-init
(-> self root-override trans)
(-> self root trans)
(-> *CRATE-bank* DARKECO_EXPLODE_RADIUS)
30
:to self
@@ -857,7 +849,7 @@
#f
#f
#f
(-> self root-override trans)
(-> self root trans)
:to *entity-pool*
)
)
@@ -870,7 +862,7 @@
#f
#f
#f
(-> self root-override trans)
(-> self root trans)
:to *entity-pool*
)
)
@@ -883,7 +875,7 @@
#f
#f
#f
(-> self root-override trans)
(-> self root trans)
:to *entity-pool*
)
)
@@ -958,7 +950,7 @@
)
)
)
(clear-collide-with-as (-> self root-override))
(clear-collide-with-as (-> self root))
(logior! (-> self draw status) (draw-status hidden))
(drop-pickup (-> self fact) #t self (the-as fact-info #f) 0)
(set! (-> self child-count) (+ (process-count self) -1))
@@ -979,7 +971,7 @@
(defbehavior crate-init-by-other crate ((arg0 entity) (arg1 vector) (arg2 symbol))
(params-init self arg0)
(set! (-> self root-override trans quad) (-> arg1 quad))
(set! (-> self root trans quad) (-> arg1 quad))
(set! (-> self look) arg2)
(set! (-> self defense) arg2)
(art-init self)
@@ -987,14 +979,14 @@
(none)
)
(defmethod init-from-entity! crate ((this crate) (arg0 entity-actor))
(defmethod init-from-entity! ((this crate) (arg0 entity-actor))
(params-init this arg0)
(art-init this)
(check-dead this)
(none)
)
(defmethod params-init crate ((this crate) (arg0 entity))
(defmethod params-init ((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))))
@@ -1015,7 +1007,7 @@
)
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
(backup-collide-with-as s4-0)
(set! (-> this root-override) s4-0)
(set! (-> this root) s4-0)
)
(set! (-> this fact)
(new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc))
@@ -1065,14 +1057,14 @@
(none)
)
(defmethod art-init crate ((this crate))
(defmethod art-init ((this crate))
(case (-> this look)
(('iron)
(set! (-> this root-override root-prim prim-core offense) (collide-offense normal-attack))
(set! (-> this root root-prim prim-core offense) (collide-offense normal-attack))
(initialize-skeleton this *crate-iron-sg* '())
)
(('steel)
(set! (-> this root-override root-prim prim-core offense) (collide-offense indestructible))
(set! (-> this root root-prim prim-core offense) (collide-offense indestructible))
(initialize-skeleton this *crate-steel-sg* '())
)
(('darkeco)
@@ -1104,25 +1096,25 @@
)
(cond
((logtest? (fact-options indestructible) (-> this fact options))
(set! (-> this root-override root-prim prim-core offense) (collide-offense indestructible))
(set! (-> this root root-prim prim-core offense) (collide-offense indestructible))
)
((logtest? (-> this fact options) (fact-options strong-attack))
(set! (-> this root-override root-prim prim-core offense) (collide-offense strong-attack))
(set! (-> this root root-prim prim-core offense) (collide-offense strong-attack))
)
((logtest? (-> this fact options) (fact-options normal-attack))
(set! (-> this root-override root-prim prim-core offense) (collide-offense normal-attack))
(set! (-> this root root-prim prim-core offense) (collide-offense normal-attack))
)
((logtest? (-> this fact options) (fact-options touch))
(set! (-> this root-override root-prim prim-core offense) (collide-offense touch))
(set! (-> this root root-prim prim-core offense) (collide-offense touch))
)
)
(set! (-> this base quad) (-> this root-override trans quad))
(set! (-> this base quad) (-> this root trans quad))
(crate-post)
(nav-mesh-connect this (-> this root-override) (the-as nav-control #f))
(nav-mesh-connect this (-> this root) (the-as nav-control #f))
this
)
(defmethod params-set! crate ((this crate) (arg0 symbol) (arg1 symbol))
(defmethod params-set! ((this crate) (arg0 symbol) (arg1 symbol))
(if arg0
(set! (-> this look) arg0)
)
@@ -1132,7 +1124,7 @@
(none)
)
(defmethod check-dead crate ((this crate))
(defmethod check-dead ((this crate))
(if (>= (-> this entity extra perm user-int8 0) 1)
(go (method-of-object this die) #t 0)
)
@@ -1142,11 +1134,11 @@
(none)
)
(defmethod smush-update! crate ((this crate))
(defmethod smush-update! ((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)))
(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)
@@ -1154,14 +1146,10 @@
(deftype barrel (crate)
()
:heap-base #x90
:method-count-assert 30
:size-assert #x100
:flag-assert #x1e00900100
)
(defmethod params-init barrel ((this barrel) (arg0 entity))
(defmethod params-init ((this barrel) (arg0 entity))
(let ((t9-0 (method-of-type crate params-init)))
(t9-0 this arg0)
)
@@ -1171,14 +1159,10 @@
(deftype bucket (crate)
()
:heap-base #x90
:method-count-assert 30
:size-assert #x100
:flag-assert #x1e00900100
)
(defmethod params-init bucket ((this bucket) (arg0 entity))
(defmethod params-init ((this bucket) (arg0 entity))
(let ((t9-0 (method-of-type crate params-init)))
(t9-0 this arg0)
)
@@ -1220,24 +1204,16 @@
(deftype crate-buzzer (crate)
()
:heap-base #x90
:method-count-assert 30
:size-assert #x100
:flag-assert #x1e00900100
)
(defmethod art-init crate-buzzer ((this crate-buzzer))
(defmethod art-init ((this crate-buzzer))
(let ((t9-0 (method-of-type crate art-init)))
(t9-0 this)
)
(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! (-> this sound)
(new 'process 'ambient-sound (static-sound-spec "buzzer" :pitch-mod -762 :fo-max 40) (-> this root trans))
)
(set! (-> this victory-anim) (fuel-cell-pick-anim this))
(the-as crate this)
@@ -1246,27 +1222,25 @@
(defstate wait (crate-buzzer)
:virtual #t
:trans (behavior ()
(when (and (and *target*
(>= 327680.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))
)
(when (and (and *target* (>= 327680.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))))
(time-elapsed? (-> self state-time) (seconds 1.5))
(rand-vu-percent? 0.03)
)
(spawn (-> self part) (-> self root-override trans))
(spawn (-> self part) (-> self root trans))
(activate! (-> self smush) 0.2 90 150 1.0 1.0)
(logclear! (-> self mask) (process-mask sleep-code))
)
(if (nonzero? (-> self sound))
(update! (-> self sound))
)
(if (and *target* (>= (-> *target* fact-info-target buzzer) 6.0))
(if (and *target* (>= (-> *target* fact buzzer) 6.0))
(spool-push *art-control* (-> self victory-anim name) 0 self -99.0)
)
)
:code (behavior ()
(set-time! (-> self state-time))
(suspend)
(update-transforms! (-> self root-override))
(update-transforms! (-> self root))
(loop
(set-time! (-> self state-time))
(ja-post)
@@ -1276,9 +1250,9 @@
(sound-play "crate-jump")
(while (or (!= (-> self smush amp) 0.0) (!= f30-0 0.0))
(+! 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))
(+! (-> self root trans y) (* f30-0 (seconds-per-frame)))
(when (< (-> self root trans y) (-> self base y))
(set! (-> self root trans y) (-> self base y))
(set! f30-0 (* -0.5 f30-0))
(if (< (fabs f30-0) 16384.0)
(set! f30-0 0.0)
@@ -1289,7 +1263,7 @@
(suspend)
)
)
(set! (-> self root-override trans y) (-> self base y))
(set! (-> self root trans y) (-> self base y))
)
)
:post #f
@@ -1299,7 +1273,7 @@
:virtual #t
:code (behavior ()
(while (!= (-> self smush amp) 0.0)
(spawn (-> self part) (-> self root-override trans))
(spawn (-> self part) (-> self root trans))
(suspend)
)
(go-virtual wait)
@@ -1307,16 +1281,12 @@
)
(deftype pickup-spawner (crate)
((blocker entity-actor :offset-assert 256)
((blocker entity-actor)
)
:heap-base #xa0
:method-count-assert 30
:size-assert #x104
:flag-assert #x1e00a00104
)
(defmethod params-init pickup-spawner ((this pickup-spawner) (arg0 entity))
(defmethod params-init ((this pickup-spawner) (arg0 entity))
(let ((t9-0 (method-of-type crate params-init)))
(t9-0 this arg0)
)
@@ -1328,7 +1298,7 @@
(none)
)
(defmethod check-dead pickup-spawner ((this pickup-spawner))
(defmethod check-dead ((this pickup-spawner))
(go (method-of-object this wait))
0
(none)
@@ -9,10 +9,6 @@
(deftype dark-eco-pool (water-anim)
()
:heap-base #x70
:method-count-assert 30
:size-assert #xdc
:flag-assert #x1e007000dc
)
@@ -84,7 +80,7 @@
)
)
(defmethod water-vol-method-25 dark-eco-pool ((this dark-eco-pool))
(defmethod water-vol-method-25 ((this dark-eco-pool))
(let ((t9-0 (method-of-type water-anim water-vol-method-25)))
(t9-0 this)
)
@@ -108,7 +104,7 @@
(none)
)
(defmethod water-vol-method-22 dark-eco-pool ((this dark-eco-pool))
(defmethod water-vol-method-22 ((this dark-eco-pool))
(let ((t9-0 (method-of-type water-anim water-vol-method-22)))
(t9-0 this)
)
+89 -122
View File
@@ -16,7 +16,8 @@
(define-extern birth-pickup-at-point (function vector pickup-type float symbol process-tree fact-info (pointer process) :behavior process))
(declare-type collide-shape-moving basic)
(declare-type collide-shape trsqv)
(declare-type collide-shape-moving collide-shape)
(declare-type sparticle-launch-group basic)
(declare-type part-tracker process)
(declare-type collide-prim-core structure)
@@ -36,44 +37,36 @@
;; A manipy is a way to draw and move something. More complicated objects that want to draw multiple
;; things may create a child manipy and then send it commands.
(deftype manipy (process-drawable)
((new-trans-hook (function none) :offset-assert 176)
(cur-trans-hook (function none) :offset-assert 180)
(cur-event-hook (function none) :offset-assert 184)
(new-joint-anim art-joint-anim :offset-assert 188)
(new-joint-anim-blend uint64 :offset-assert 192)
(anim-mode symbol :offset-assert 200)
(cur-grab-handle handle :offset-assert 208)
(cur-target-handle handle :offset-assert 216)
(old-grab-pos vector :inline :offset-assert 224)
(joint joint-mod 4 :offset-assert 240)
(new-post-hook (function none) :offset-assert 256)
(cur-post-hook (function none) :offset-assert 260)
(clone-copy-trans symbol :offset-assert 264)
(shadow-backup basic :offset-assert 268)
(draw? symbol :offset-assert 272)
((new-trans-hook (function none))
(cur-trans-hook (function none))
(cur-event-hook (function none))
(new-joint-anim art-joint-anim)
(new-joint-anim-blend uint64)
(anim-mode symbol)
(cur-grab-handle handle)
(cur-target-handle handle)
(old-grab-pos vector :inline)
(joint joint-mod 4)
(new-post-hook (function none))
(cur-post-hook (function none))
(clone-copy-trans symbol)
(shadow-backup basic)
(draw? symbol)
)
:heap-base #xb0
:method-count-assert 20
:size-assert #x114
:flag-assert #x1400b00114
(:states
manipy-idle
)
)
;; A part-spawner simply spawns particles.
(deftype part-spawner (process-drawable)
((mode (pointer sparticle-launch-group) :offset-assert 176)
(enable symbol :offset-assert 180)
(radius meters :offset-assert 184)
(world-sphere sphere :inline :offset-assert 192)
((mode (pointer sparticle-launch-group))
(enable symbol)
(radius meters)
(world-sphere sphere :inline)
)
:heap-base #x60
:method-count-assert 21
:size-assert #xd0
:flag-assert #x15006000d0
(:methods
(is-visible? (_type_) symbol 20)
(is-visible? (_type_) symbol)
)
(:states
part-spawner-active
@@ -83,24 +76,20 @@
;; a part-tracker will spawn particles, then linger for a bit, and then finally die.
;; a more complicated object can use this to manage particles that do something interesting (like follow you)
(deftype part-tracker (process)
((root trsqv :offset-assert 112)
(part sparticle-launch-control :offset-assert 116)
(target handle :offset-assert 120)
(callback (function part-tracker vector) :offset-assert 128)
(linger-callback (function part-tracker vector) :offset-assert 132)
(duration time-frame :offset-assert 136)
(linger-duration time-frame :offset-assert 144)
(start-time time-frame :offset-assert 152)
(offset vector :inline :offset-assert 160)
(userdata uint64 :offset-assert 176)
(user-time time-frame 2 :offset-assert 184)
(user-vector vector 2 :inline :offset-assert 208)
(user-handle uint32 2 :offset-assert 240)
((root trsqv)
(part sparticle-launch-control)
(target handle)
(callback (function part-tracker vector))
(linger-callback (function part-tracker vector))
(duration time-frame)
(linger-duration time-frame)
(start-time time-frame)
(offset vector :inline)
(userdata uint64)
(user-time time-frame 2)
(user-vector vector 2 :inline)
(user-handle uint32 2)
)
:heap-base #x90
:method-count-assert 14
:size-assert #xf8
:flag-assert #xe009000f8
(:states
part-tracker-process
)
@@ -108,32 +97,28 @@
;; a camera-tracker can control the camera.
(deftype camera-tracker (process)
((grab-target handle :offset 120)
(grab-event symbol :offset-assert 128)
(release-event symbol :offset-assert 132)
(old-global-mask process-mask :offset-assert 136)
(old-self-mask process-mask :offset-assert 140)
(old-parent-mask process-mask :offset-assert 144)
(look-at-target handle :offset-assert 152)
(pov-target handle :offset-assert 160)
(work-process handle :offset-assert 168)
(anim-process handle :offset-assert 176)
(start-time time-frame :offset-assert 184)
(callback basic :offset-assert 192)
(userdata basic :offset-assert 196)
(message basic :offset-assert 200)
(border-value basic :offset-assert 204)
(mask-to-clear process-mask :offset-assert 208)
(script pair :offset-assert 212)
(script-line pair :offset-assert 216)
(script-func (function none) :offset-assert 220)
((grab-target handle :offset 120)
(grab-event symbol)
(release-event symbol)
(old-global-mask process-mask)
(old-self-mask process-mask)
(old-parent-mask process-mask)
(look-at-target handle)
(pov-target handle)
(work-process handle)
(anim-process handle)
(start-time time-frame)
(callback basic)
(userdata basic)
(message basic)
(border-value basic)
(mask-to-clear process-mask)
(script pair)
(script-line pair)
(script-func (function none))
)
:heap-base #x70
:method-count-assert 15
:size-assert #xe0
:flag-assert #xf007000e0
(:methods
(eval (_type_ pair) process 14)
(eval (_type_ pair) process)
)
(:states
camera-tracker-process
@@ -142,18 +127,14 @@
;; a touch tracker waits to be touched, then calls some callback function.
(deftype touch-tracker (process-drawable)
((root-override collide-shape-moving :offset 112)
(duration time-frame :offset-assert 176)
(target handle :offset-assert 184)
(event symbol :offset-assert 192)
(run-function (function object) :offset-assert 196)
(callback (function touch-tracker none) :offset-assert 200)
(event-mode basic :offset-assert 204)
((root collide-shape-moving :override)
(duration time-frame)
(target handle)
(event symbol)
(run-function (function object))
(callback (function touch-tracker none))
(event-mode basic)
)
:heap-base #x60
:method-count-assert 20
:size-assert #xd0
:flag-assert #x14006000d0
(:states
touch-tracker-idle
)
@@ -161,15 +142,11 @@
;; the classic pole
(deftype swingpole (process)
((root trsq :offset-assert 112)
(dir vector :inline :offset-assert 128)
(range meters :offset-assert 144)
(edge-length meters :offset-assert 148)
((root trsq)
(dir vector :inline)
(range meters)
(edge-length meters)
)
:heap-base #x30
:method-count-assert 14
:size-assert #x98
:flag-assert #xe00300098
(:states
swingpole-active
swingpole-stance
@@ -178,42 +155,35 @@
;; do you want to fish?
(deftype gui-query (structure)
((x-position int32 :offset-assert 0)
(y-position int32 :offset-assert 4)
(message string :offset-assert 8)
(decision symbol :offset-assert 12)
(only-allow-cancel symbol :offset-assert 16)
(no-msg string :offset-assert 20)
(message-space int32 :offset-assert 24)
((x-position int32)
(y-position int32)
(message string)
(decision symbol)
(only-allow-cancel symbol)
(no-msg string)
(message-space int32)
)
:pack-me
:method-count-assert 11
:size-assert #x1c
:flag-assert #xb0000001c
(:methods
(init! (_type_ string int int int symbol string) none 9)
(get-response (_type_) symbol 10)
(init! (_type_ string int int int symbol string) none)
(get-response (_type_) symbol)
)
)
;; control the camera from something else (an animation)
(deftype othercam (process)
((hand handle :offset-assert 112)
(old-global-mask process-mask :offset-assert 120)
(mask-to-clear process-mask :offset-assert 124)
(cam-joint-index int32 :offset-assert 128)
(old-pos vector :inline :offset-assert 144)
(old-mat-z vector :inline :offset-assert 160)
(had-valid-frame basic :offset-assert 176)
(border-value basic :offset-assert 180)
(die? symbol :offset-assert 184)
(survive-anim-end? symbol :offset-assert 188)
(spooling? symbol :offset-assert 192)
((hand handle)
(old-global-mask process-mask)
(mask-to-clear process-mask)
(cam-joint-index int32)
(old-pos vector :inline)
(old-mat-z vector :inline)
(had-valid-frame basic)
(border-value basic)
(die? symbol)
(survive-anim-end? symbol)
(spooling? symbol)
)
:heap-base #x60
:method-count-assert 14
:size-assert #xc4
:flag-assert #xe006000c4
(:states
othercam-running
)
@@ -223,10 +193,7 @@
;; don't draw it! I guess used to disable things during development.
(deftype process-hidden (process)
()
:method-count-assert 15
:size-assert #x70
:flag-assert #xf00000070
(:methods
(die () _type_ :state 14)
(:state-methods
die
)
)
+44 -62
View File
@@ -138,7 +138,7 @@
)
)
(defmethod init-from-entity! swingpole ((this swingpole) (arg0 entity-actor))
(defmethod init-from-entity! ((this swingpole) (arg0 entity-actor))
"Copy defaults from the entity."
(stack-size-set! (-> this main-thread) 128)
(logior! (-> this mask) (process-mask actor-pause))
@@ -160,7 +160,7 @@
:code nothing
)
(defmethod init-from-entity! process-hidden ((this process-hidden) (arg0 entity-actor))
(defmethod init-from-entity! ((this process-hidden) (arg0 entity-actor))
"Copy defaults from the entity."
(process-entity-status! this (entity-perm-status dead) #t)
(go (method-of-object this die))
@@ -169,17 +169,11 @@
(deftype target-start (process-hidden)
()
:method-count-assert 15
:size-assert #x70
:flag-assert #xf00000070
)
(deftype camera-start (process-hidden)
()
:method-count-assert 15
:size-assert #x70
:flag-assert #xf00000070
)
@@ -542,7 +536,7 @@
(none)
)
(defmethod deactivate part-tracker ((this part-tracker))
(defmethod deactivate ((this part-tracker))
(if (nonzero? (-> this part))
(kill-and-free-particles (-> this part))
)
@@ -900,7 +894,7 @@
)
;; ERROR: Failed load: (set! v1-42 (l.wu (+ a0-22 -4))) at op 159
(defmethod eval camera-tracker ((this camera-tracker) (arg0 pair))
(defmethod eval ((this camera-tracker) (arg0 pair))
(with-pp
(let ((gp-0 (the-as object #f)))
(cond
@@ -1180,14 +1174,10 @@
)
(deftype med-res-level (process-drawable)
((level symbol :offset-assert 176)
(part-mode basic :offset-assert 180)
(index int32 :offset-assert 184)
((level symbol)
(part-mode basic)
(index int32)
)
:heap-base #x50
:method-count-assert 20
:size-assert #xbc
:flag-assert #x14005000bc
(:states
med-res-level-idle
)
@@ -1253,7 +1243,7 @@
(define *lev-string* (new 'global 'string 64 (the-as string #f)))
(defmethod init-from-entity! med-res-level ((this med-res-level) (arg0 entity-actor))
(defmethod init-from-entity! ((this med-res-level) (arg0 entity-actor))
(local-vars (sv-16 res-tag))
(stack-size-set! (-> this main-thread) 128)
"#f"
@@ -1317,7 +1307,7 @@
(none)
)
(defmethod is-visible? part-spawner ((this part-spawner))
(defmethod is-visible? ((this part-spawner))
(sphere<-vector+r! (-> this world-sphere) (-> this root trans) (-> this radius))
(sphere-in-view-frustum? (-> this world-sphere))
)
@@ -1356,7 +1346,7 @@
)
)
(defmethod init-from-entity! part-spawner ((this part-spawner) (arg0 entity-actor))
(defmethod init-from-entity! ((this part-spawner) (arg0 entity-actor))
(local-vars (sv-16 res-tag))
(stack-size-set! (-> this main-thread) 128)
(logior! (-> this mask) (process-mask ambient))
@@ -1418,18 +1408,14 @@
)
(deftype launcher (process-drawable)
((root-override collide-shape :offset 112)
(spring-height meters :offset-assert 176)
(camera state :offset-assert 180)
(active-distance float :offset-assert 184)
(seek-time time-frame :offset-assert 192)
(dest vector :inline :offset-assert 208)
(sound-id sound-id :offset-assert 224)
((root collide-shape :override)
(spring-height meters)
(camera state)
(active-distance float)
(seek-time time-frame)
(dest vector :inline)
(sound-id sound-id)
)
:heap-base #x80
:method-count-assert 20
:size-assert #xe4
:flag-assert #x14008000e4
(:states
launcher-active
launcher-deactivated
@@ -1865,15 +1851,14 @@
(go launcher-deactivated)
)
(('trans)
(move-to-point! (-> self root-override) (the-as vector (-> block param 0)))
(update-transforms! (-> self root-override))
(move-to-point! (-> self root) (the-as vector (-> block param 0)))
(update-transforms! (-> self root))
)
)
)
:trans (behavior ()
(when (and *target* (>= (-> self active-distance)
(vector-vector-distance (-> self root-override trans) (-> *target* control trans))
)
(when (and *target*
(>= (-> self active-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans)))
)
(cond
((send-event *target* 'query 'powerup (pickup-type eco-blue))
@@ -1887,7 +1872,7 @@
)
)
)
(if (and (and *target* (>= 32768.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))))
(if (and (and *target* (>= 32768.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))))
(not (send-event *target* 'query 'powerup (pickup-type eco-blue)))
)
(level-hint-spawn
@@ -1914,8 +1899,8 @@
(go launcher-deactivated)
)
((= message 'trans)
(move-to-point! (-> self root-override) (the-as vector (-> block param 0)))
(update-transforms! (-> self root-override))
(move-to-point! (-> self root) (the-as vector (-> block param 0)))
(update-transforms! (-> self root))
)
)
)
@@ -1931,18 +1916,17 @@
)
)
:trans (behavior ()
(if (or (or (not *target*) (< (-> self active-distance)
(vector-vector-distance (-> self root-override trans) (-> *target* control trans))
)
(if (or (or (not *target*)
(< (-> self active-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans)))
)
(not (send-event *target* 'query 'powerup (pickup-type eco-blue)))
)
(go launcher-idle)
)
(spawn (-> self part) (-> self root-override trans))
(spawn (-> self part) (-> self root trans))
(sound-play "launch-idle" :id (-> self sound-id))
(if (and (and *target* (>= (+ 2867.2 (-> self root-override root-prim prim-core world-sphere w))
(vector-vector-distance (-> self root-override trans) (-> *target* control trans))
(if (and (and *target* (>= (+ 2867.2 (-> self root root-prim prim-core world-sphere w))
(vector-vector-distance (-> self root trans) (-> *target* control trans))
)
)
(not (time-elapsed? (-> self state-time) (seconds 0.5)))
@@ -1960,7 +1944,7 @@
:code anim-loop
)
(defmethod init-from-entity! launcher ((this launcher) (arg0 entity-actor))
(defmethod init-from-entity! ((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))))
@@ -1971,10 +1955,10 @@
)
(set! (-> s4-0 nav-radius) 13926.4)
(backup-collide-with-as s4-0)
(set! (-> this root-override) s4-0)
(set! (-> this root) s4-0)
)
(process-drawable-from-entity! this arg0)
(update-transforms! (-> this root-override))
(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)))
@@ -2016,7 +2000,7 @@
)
)
(set! (-> this sound-id) (new-sound-id))
(nav-mesh-connect this (-> this root-override) (the-as nav-control #f))
(nav-mesh-connect this (-> this root) (the-as nav-control #f))
(go launcher-idle)
(none)
)
@@ -2032,12 +2016,12 @@
)
(set! (-> s2-0 nav-radius) (* 0.75 (-> s2-0 root-prim local-sphere w)))
(backup-collide-with-as s2-0)
(set! (-> self root-override) s2-0)
(set! (-> self root) s2-0)
)
(set! (-> self root-override trans quad) (-> arg0 quad))
(set-vector! (-> self root-override scale) 1.0 1.0 1.0 1.0)
(set-vector! (-> self root-override quat) 0.0 0.0 0.0 1.0)
(update-transforms! (-> self root-override))
(set! (-> self root trans quad) (-> arg0 quad))
(set-vector! (-> self root scale) 1.0 1.0 1.0 1.0)
(set-vector! (-> self root quat) 0.0 0.0 0.0 1.0)
(update-transforms! (-> self root))
(set! (-> self spring-height) arg1)
(set! (-> self active-distance) arg3)
(let ((v1-23 (-> self entity extra level name)))
@@ -2191,9 +2175,7 @@
)
)
(if a0-6
(set! (-> self root-override trans quad)
(-> (the-as collide-shape a0-6) root-prim prim-core world-sphere quad)
)
(set! (-> self root trans quad) (-> (the-as collide-shape a0-6) root-prim prim-core world-sphere quad))
)
)
)
@@ -2201,15 +2183,15 @@
(if (-> self callback)
((-> self callback) self)
)
(update-transforms! (-> self root-override))
(update-transforms! (-> self root))
(let ((a1-3 (new 'stack-no-clear 'touching-shapes-entry)))
(set! (-> a1-3 cshape1) (the-as collide-shape 2))
(set! (-> a1-3 cshape2) (the-as collide-shape *touching-list*))
(find-overlapping-shapes (-> self root-override) (the-as overlaps-others-params a1-3))
(find-overlapping-shapes (-> self root) (the-as overlaps-others-params a1-3))
)
(suspend)
)
(clear-collide-with-as (-> self root-override))
(clear-collide-with-as (-> self root))
(suspend)
0
)
@@ -2232,9 +2214,9 @@
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
(backup-collide-with-as s4-0)
(set! (-> s4-0 event-self) 'touched)
(set! (-> self root-override) s4-0)
(set! (-> self root) s4-0)
)
(set! (-> self root-override trans quad) (-> arg0 quad))
(set! (-> self root trans quad) (-> arg0 quad))
(set! (-> self duration) arg2)
(set! (-> self target) (the-as handle #f))
(set! (-> self event) #f)
+135 -140
View File
@@ -51,152 +51,147 @@
;; DECOMP BEGINS
(deftype nav-enemy-info (basic)
((idle-anim int32 :offset-assert 4)
(walk-anim int32 :offset-assert 8)
(turn-anim int32 :offset-assert 12)
(notice-anim int32 :offset-assert 16)
(run-anim int32 :offset-assert 20)
(jump-anim int32 :offset-assert 24)
(jump-land-anim int32 :offset-assert 28)
(victory-anim int32 :offset-assert 32)
(taunt-anim int32 :offset-assert 36)
(die-anim int32 :offset-assert 40)
(neck-joint int32 :offset-assert 44)
(player-look-at-joint int32 :offset-assert 48)
(run-travel-speed meters :offset-assert 52)
(run-rotate-speed degrees :offset-assert 56)
(run-acceleration meters :offset-assert 60)
(run-turn-time seconds :offset-assert 64)
(walk-travel-speed meters :offset-assert 72)
(walk-rotate-speed degrees :offset-assert 76)
(walk-acceleration meters :offset-assert 80)
(walk-turn-time seconds :offset-assert 88)
(attack-shove-back meters :offset-assert 96)
(attack-shove-up meters :offset-assert 100)
(shadow-size meters :offset-assert 104)
(notice-nav-radius meters :offset-assert 108)
(nav-nearest-y-threshold meters :offset-assert 112)
(notice-distance meters :offset-assert 116)
(proximity-notice-distance meters :offset-assert 120)
(stop-chase-distance meters :offset-assert 124)
(frustration-distance meters :offset-assert 128)
(frustration-time time-frame :offset-assert 136)
(die-anim-hold-frame float :offset-assert 144)
(jump-anim-start-frame float :offset-assert 148)
(jump-land-anim-end-frame float :offset-assert 152)
(jump-height-min meters :offset-assert 156)
(jump-height-factor float :offset-assert 160)
(jump-start-anim-speed float :offset-assert 164)
(shadow-max-y meters :offset-assert 168)
(shadow-min-y meters :offset-assert 172)
(shadow-locus-dist meters :offset-assert 176)
(use-align symbol :offset-assert 180)
(draw-shadow symbol :offset-assert 184)
(move-to-ground symbol :offset-assert 188)
(hover-if-no-ground symbol :offset-assert 192)
(use-momentum symbol :offset-assert 196)
(use-flee symbol :offset-assert 200)
(use-proximity-notice symbol :offset-assert 204)
(use-jump-blocked symbol :offset-assert 208)
(use-jump-patrol symbol :offset-assert 212)
(gnd-collide-with collide-kind :offset-assert 216)
(debug-draw-neck symbol :offset-assert 224)
(debug-draw-jump symbol :offset-assert 228)
((idle-anim int32)
(walk-anim int32)
(turn-anim int32)
(notice-anim int32)
(run-anim int32)
(jump-anim int32)
(jump-land-anim int32)
(victory-anim int32)
(taunt-anim int32)
(die-anim int32)
(neck-joint int32)
(player-look-at-joint int32)
(run-travel-speed meters)
(run-rotate-speed degrees)
(run-acceleration meters)
(run-turn-time seconds)
(walk-travel-speed meters)
(walk-rotate-speed degrees)
(walk-acceleration meters)
(walk-turn-time seconds)
(attack-shove-back meters)
(attack-shove-up meters)
(shadow-size meters)
(notice-nav-radius meters)
(nav-nearest-y-threshold meters)
(notice-distance meters)
(proximity-notice-distance meters)
(stop-chase-distance meters)
(frustration-distance meters)
(frustration-time time-frame)
(die-anim-hold-frame float)
(jump-anim-start-frame float)
(jump-land-anim-end-frame float)
(jump-height-min meters)
(jump-height-factor float)
(jump-start-anim-speed float)
(shadow-max-y meters)
(shadow-min-y meters)
(shadow-locus-dist meters)
(use-align symbol)
(draw-shadow symbol)
(move-to-ground symbol)
(hover-if-no-ground symbol)
(use-momentum symbol)
(use-flee symbol)
(use-proximity-notice symbol)
(use-jump-blocked symbol)
(use-jump-patrol symbol)
(gnd-collide-with collide-kind)
(debug-draw-neck symbol)
(debug-draw-jump symbol)
)
:method-count-assert 9
:size-assert #xe8
:flag-assert #x9000000e8
)
(deftype nav-enemy (process-drawable)
((collide-info collide-shape-moving :offset 112)
(enemy-info fact-info-enemy :offset 144)
(hit-from-dir vector :inline :offset-assert 176)
(event-param-point vector :inline :offset-assert 192)
(frustration-point vector :inline :offset-assert 208)
(jump-dest vector :inline :offset-assert 224)
(jump-trajectory trajectory :inline :offset-assert 240)
(jump-time time-frame :offset-assert 280)
(nav-info nav-enemy-info :offset-assert 288)
(target-speed float :offset-assert 292)
(momentum-speed float :offset-assert 296)
(acceleration float :offset-assert 300)
(rotate-speed float :offset-assert 304)
(turn-time time-frame :offset-assert 312)
(frustration-time time-frame :offset-assert 320)
(speed-scale float :offset-assert 328)
(neck joint-mod :offset-assert 332)
(reaction-time time-frame :offset-assert 336)
(notice-time time-frame :offset-assert 344)
(state-timeout time-frame :offset-assert 352)
(free-time time-frame :offset-assert 360)
(touch-time time-frame :offset-assert 368)
(nav-enemy-flags nav-enemy-flags :offset-assert 376)
(incomming-attack-id handle :offset-assert 384)
(jump-return-state (state process) :offset-assert 392)
(rand-gen random-generator :offset-assert 396)
((collide-info collide-shape-moving :overlay-at root)
(enemy-info fact-info-enemy :overlay-at fact)
(hit-from-dir vector :inline)
(event-param-point vector :inline)
(frustration-point vector :inline)
(jump-dest vector :inline)
(jump-trajectory trajectory :inline)
(jump-time time-frame)
(nav-info nav-enemy-info)
(target-speed float)
(momentum-speed float)
(acceleration float)
(rotate-speed float)
(turn-time time-frame)
(frustration-time time-frame)
(speed-scale float)
(neck joint-mod)
(reaction-time time-frame)
(notice-time time-frame)
(state-timeout time-frame)
(free-time time-frame)
(touch-time time-frame)
(nav-enemy-flags nav-enemy-flags)
(incomming-attack-id handle)
(jump-return-state (state process))
(rand-gen random-generator)
)
:heap-base #x120
:method-count-assert 76
:size-assert #x190
:flag-assert #x4c01200190
(:state-methods
nav-enemy-attack
nav-enemy-chase
nav-enemy-flee
nav-enemy-die
nav-enemy-fuel-cell
nav-enemy-give-up
nav-enemy-jump
nav-enemy-jump-land
nav-enemy-idle
nav-enemy-notice
nav-enemy-patrol
nav-enemy-stare
nav-enemy-stop-chase
nav-enemy-victory
)
(:methods
(nav-enemy-attack () _type_ :state 20)
(nav-enemy-chase () _type_ :state 21)
(nav-enemy-flee () _type_ :state 22)
(nav-enemy-die () _type_ :state 23)
(nav-enemy-fuel-cell () _type_ :state 24)
(nav-enemy-give-up () _type_ :state 25)
(nav-enemy-jump () _type_ :state 26)
(nav-enemy-jump-land () _type_ :state 27)
(nav-enemy-idle () _type_ :state 28)
(nav-enemy-notice () _type_ :state 29)
(nav-enemy-patrol () _type_ :state 30)
(nav-enemy-stare () _type_ :state 31)
(nav-enemy-stop-chase () _type_ :state 32)
(nav-enemy-victory () _type_ :state 33)
(nav-enemy-method-34 (_type_) none 34)
(nav-enemy-wait-for-cue () _type_ :state 35)
(nav-enemy-jump-to-point () _type_ :state 36)
(nav-enemy-method-37 (_type_) none 37)
(nav-enemy-method-38 (_type_) none 38)
(common-post (_type_) none 39)
(nav-enemy-method-40 (_type_) none 40)
(nav-enemy-method-41 (_type_) none 41)
(new-patrol-point! (_type_) int 42)
(attack-handler (_type_ process event-message-block) object 43)
(touch-handler (_type_ process event-message-block) object 44)
(init-defaults! (_type_ nav-enemy-info) none 45)
(target-in-range? (_type_ float) basic 46)
(initialize-collision (_type_) none 47)
(nav-enemy-method-48 (_type_) none 48)
(init-jm! (_type_ nav-enemy-info) float 49)
(nav-enemy-method-50 (_type_ vector) symbol 50)
(nav-enemy-method-51 (_type_) none 51)
(nav-enemy-method-52 (_type_ vector) symbol 52)
(nav-enemy-method-53 (_type_) symbol 53)
(nav-enemy-method-54 (_type_ vector) symbol 54)
(nav-enemy-method-55 (_type_) symbol 55)
(set-jump-height-factor! (_type_ int) none 56)
(nav-enemy-method-57 (_type_) none 57)
(nav-enemy-method-58 (_type_) none 58)
(nav-enemy-method-59 (_type_) none 59)
(nav-enemy-method-60 (_type_ symbol) symbol 60)
(snow-bunny-attack () _type_ :state 61)
(snow-bunny-chase-hop () _type_ :state 62)
(snow-bunny-defend () _type_ :state 63)
(nav-enemy-method-64 () _type_ :state 64)
(snow-bunny-lunge () _type_ :state 65)
(snow-bunny-nav-resume () _type_ :state 66)
(snow-bunny-patrol-hop () _type_ :state 67)
(snow-bunny-patrol-idle () _type_ :state 68)
(nav-enemy-method-69 () _type_ :state 69)
(snow-bunny-retreat-hop () _type_ :state 70)
(snow-bunny-tune-spheres () _type_ :state 71)
(nav-enemy-touch-handler (_type_ process event-message-block) object 72)
(nav-enemy-attack-handler (_type_ process event-message-block) object 73)
(nav-enemy-jump-blocked () _type_ :state 74)
(nav-enemy-method-75 () _type_ :state 75)
(nav-enemy-method-34 (_type_) none)
(nav-enemy-wait-for-cue () _type_ :state)
(nav-enemy-jump-to-point () _type_ :state)
(nav-enemy-method-37 (_type_) none)
(nav-enemy-method-38 (_type_) none)
(common-post (_type_) none)
(nav-enemy-method-40 (_type_) none)
(nav-enemy-method-41 (_type_) none)
(new-patrol-point! (_type_) int)
(attack-handler (_type_ process event-message-block) object)
(touch-handler (_type_ process event-message-block) object)
(init-defaults! (_type_ nav-enemy-info) none)
(target-in-range? (_type_ float) basic)
(initialize-collision (_type_) none)
(nav-enemy-method-48 (_type_) none)
(init-jm! (_type_ nav-enemy-info) float)
(nav-enemy-method-50 (_type_ vector) symbol)
(nav-enemy-method-51 (_type_) none)
(nav-enemy-method-52 (_type_ vector) symbol)
(nav-enemy-method-53 (_type_) symbol)
(nav-enemy-method-54 (_type_ vector) symbol)
(nav-enemy-method-55 (_type_) symbol)
(set-jump-height-factor! (_type_ int) none)
(nav-enemy-method-57 (_type_) none)
(nav-enemy-method-58 (_type_) none)
(nav-enemy-method-59 (_type_) none)
(nav-enemy-method-60 (_type_ symbol) symbol)
(snow-bunny-attack () _type_ :state)
(snow-bunny-chase-hop () _type_ :state)
(snow-bunny-defend () _type_ :state)
(nav-enemy-method-64 () _type_ :state)
(snow-bunny-lunge () _type_ :state)
(snow-bunny-nav-resume () _type_ :state)
(snow-bunny-patrol-hop () _type_ :state)
(snow-bunny-patrol-idle () _type_ :state)
(nav-enemy-method-69 () _type_ :state)
(snow-bunny-retreat-hop () _type_ :state)
(snow-bunny-tune-spheres () _type_ :state)
(nav-enemy-touch-handler (_type_ process event-message-block) object)
(nav-enemy-attack-handler (_type_ process event-message-block) object)
(nav-enemy-jump-blocked () _type_ :state)
(nav-enemy-method-75 () _type_ :state)
)
)
+21 -21
View File
@@ -37,13 +37,13 @@
)
)
(defmethod eval-position! trajectory ((this trajectory) (time float) (result vector))
(defmethod eval-position! ((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 ((this nav-enemy) (arg0 int))
(defmethod relocate ((this nav-enemy) (arg0 int))
(if (nonzero? (-> this neck))
(set! (-> this neck) (the-as joint-mod (+ (the-as int (-> this neck)) arg0)))
)
@@ -53,7 +53,7 @@
(call-parent-method this arg0)
)
(defmethod new-patrol-point! nav-enemy ((this nav-enemy))
(defmethod new-patrol-point! ((this nav-enemy))
(local-vars (v1-11 symbol))
(if (<= (-> this path curve num-cverts) 0)
(go process-drawable-art-error "no path")
@@ -73,7 +73,7 @@
0
)
(defmethod common-post nav-enemy ((this nav-enemy))
(defmethod common-post ((this nav-enemy))
(when (and (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf8))
(or (not *target*)
(and (not (logtest? (-> *target* state-flags)
@@ -113,7 +113,7 @@
(none)
)
(defmethod touch-handler nav-enemy ((this nav-enemy) (arg0 process) (arg1 event-message-block))
(defmethod touch-handler ((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))
@@ -125,7 +125,7 @@
)
)
(defmethod nav-enemy-touch-handler nav-enemy ((this nav-enemy) (arg0 process) (arg1 event-message-block))
(defmethod nav-enemy-touch-handler ((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))
@@ -137,14 +137,14 @@
)
)
(defmethod nav-enemy-attack-handler nav-enemy ((this nav-enemy) (arg0 process) (arg1 event-message-block))
(defmethod nav-enemy-attack-handler ((this nav-enemy) (arg0 process) (arg1 event-message-block))
(send-event arg0 'get-attack-count 1)
(logclear! (-> this mask) (process-mask actor-pause attackable))
(go (method-of-object this nav-enemy-die))
'die
)
(defmethod attack-handler nav-enemy ((this nav-enemy) (arg0 process) (arg1 event-message-block))
(defmethod attack-handler ((this nav-enemy) (arg0 process) (arg1 event-message-block))
(cond
((logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf5))
(send-event arg0 'get-attack-count 1)
@@ -262,13 +262,13 @@ nav-enemy-default-event-handler
(none)
)
(defmethod nav-enemy-method-40 nav-enemy ((this nav-enemy))
(defmethod nav-enemy-method-40 ((this nav-enemy))
(nav-control-method-11 (-> this nav) (-> this nav target-pos))
0
(none)
)
(defmethod nav-enemy-method-41 nav-enemy ((this nav-enemy))
(defmethod nav-enemy-method-41 ((this nav-enemy))
(cond
((-> this nav-info use-align)
(align-vel-and-quat-only!
@@ -318,7 +318,7 @@ nav-enemy-default-event-handler
(none)
)
(defmethod nav-enemy-method-37 nav-enemy ((this nav-enemy))
(defmethod nav-enemy-method-37 ((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))
@@ -341,7 +341,7 @@ nav-enemy-default-event-handler
(none)
)
(defmethod nav-enemy-method-38 nav-enemy ((this nav-enemy))
(defmethod nav-enemy-method-38 ((this nav-enemy))
(if (-> this nav-info move-to-ground)
(integrate-for-enemy-with-move-to-ground!
(-> this collide-info)
@@ -499,7 +499,7 @@ nav-enemy-default-event-handler
)
)
(defmethod target-in-range? nav-enemy ((this nav-enemy) (arg0 float))
(defmethod target-in-range? ((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)
@@ -726,7 +726,7 @@ nav-enemy-default-event-handler
(none)
)
(defmethod run-logic? nav-enemy ((this nav-enemy))
(defmethod run-logic? ((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))
@@ -1635,7 +1635,7 @@ nav-enemy-default-event-handler
)
)
(defmethod init-defaults! nav-enemy ((this nav-enemy) (arg0 nav-enemy-info))
(defmethod init-defaults! ((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))))
@@ -1671,7 +1671,7 @@ nav-enemy-default-event-handler
(none)
)
(defmethod init-jm! nav-enemy ((this nav-enemy) (arg0 nav-enemy-info))
(defmethod init-jm! ((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))
@@ -1707,23 +1707,23 @@ nav-enemy-default-event-handler
(none)
)
(defmethod initialize-collision nav-enemy ((this nav-enemy))
(defmethod initialize-collision ((this nav-enemy))
0
(none)
)
(defmethod nav-enemy-method-48 nav-enemy ((this nav-enemy))
(defmethod nav-enemy-method-48 ((this nav-enemy))
0
(none)
)
(defmethod nav-enemy-method-59 nav-enemy ((this nav-enemy))
(defmethod nav-enemy-method-59 ((this nav-enemy))
(go (method-of-object this nav-enemy-idle))
0
(none)
)
(defmethod init-from-entity! nav-enemy ((this nav-enemy) (arg0 entity-actor))
(defmethod init-from-entity! ((this nav-enemy) (arg0 entity-actor))
(initialize-collision this)
(process-drawable-from-entity! this arg0)
(nav-enemy-method-48 this)
@@ -1732,7 +1732,7 @@ nav-enemy-default-event-handler
(none)
)
(defmethod nav-enemy-method-50 nav-enemy ((this nav-enemy) (arg0 vector))
(defmethod nav-enemy-method-50 ((this nav-enemy) (arg0 vector))
(let ((s4-0 (new 'stack-no-clear 'vector)))
(set! (-> s4-0 quad) (-> this collide-info trans quad))
(set! (-> this collide-info trans quad) (-> arg0 quad))
+25 -32
View File
@@ -8,23 +8,19 @@
;; DECOMP BEGINS
(deftype orb-cache-top (baseplat)
((active-distance float :offset-assert 228)
(inactive-distance float :offset-assert 232)
(money-list handle 60 :offset-assert 240)
(money-pos-list float 60 :offset-assert 720)
(money-pos-actual float 60 :offset-assert 960)
(platform-pos float :offset-assert 1200)
(root-pos float :offset-assert 1204)
(money int32 :offset-assert 1208)
(activated symbol :offset-assert 1212)
((active-distance float)
(inactive-distance float)
(money-list handle 60)
(money-pos-list float 60)
(money-pos-actual float 60)
(platform-pos float)
(root-pos float)
(money int32)
(activated symbol)
)
:heap-base #x450
:method-count-assert 29
:size-assert #x4c0
:flag-assert #x1d045004c0
(:methods
(pos-logic (_type_ symbol) symbol 27)
(calculate-pos (_type_ symbol) none 28)
(pos-logic (_type_ symbol) symbol)
(calculate-pos (_type_ symbol) none)
)
(:states
(orb-cache-top-activate symbol)
@@ -56,7 +52,7 @@
)
)
:trans (behavior ()
(if (and (and *target* (>= 20480.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))))
(if (and (and *target* (>= 20480.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))))
(not (send-event *target* 'query 'powerup (pickup-type eco-blue)))
)
(level-hint-spawn
@@ -86,7 +82,7 @@
)
)
(defmethod baseplat-method-22 orb-cache-top ((this orb-cache-top))
(defmethod baseplat-method-22 ((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)
@@ -97,7 +93,7 @@
(none)
)
(defmethod calculate-pos orb-cache-top ((this orb-cache-top) (arg0 symbol))
(defmethod calculate-pos ((this orb-cache-top) (arg0 symbol))
(let ((f0-0 0.0))
(when arg0
(set! f0-0 (+ 10240.0 (* 6144.0 (the float (+ (-> this money) -1)))))
@@ -117,7 +113,7 @@
(none)
)
(defmethod pos-logic orb-cache-top ((this orb-cache-top) (arg0 symbol))
(defmethod pos-logic ((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))
@@ -147,7 +143,7 @@
(set! s3-0 #t)
)
(when (and (< f30-0 15155.2)
(and *target* (>= 16384.0 (vector-vector-distance (-> this root-override trans) (-> *target* control trans))))
(and *target* (>= 16384.0 (vector-vector-distance (-> this root trans) (-> *target* control trans))))
(< (-> (target-pos 0) y) (-> this basetrans y))
)
(set! f30-0 (if (< 14131.2 f28-0)
@@ -212,18 +208,16 @@
)
(loop
(calculate-pos self #t)
(while (not (or (not *target*) (< (-> self inactive-distance)
(vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))
)
(while (not (or (not *target*)
(< (-> self inactive-distance) (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))
)
)
(pos-logic self #t)
(suspend)
)
(calculate-pos self #f)
(while (and (not (and (and *target* (>= (-> self active-distance)
(vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))
)
(while (and (not (and (and *target*
(>= (-> self active-distance) (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))
)
(let ((a1-11 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-11 from) self)
@@ -239,9 +233,8 @@
)
(suspend)
)
(if (not (and (and *target* (>= (-> self active-distance)
(vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))
)
(if (not (and (and *target*
(>= (-> self active-distance) (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))
)
(let ((a1-14 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-14 from) self)
@@ -275,7 +268,7 @@
:post plat-post
)
(defmethod init-from-entity! orb-cache-top ((this orb-cache-top) (arg0 entity-actor))
(defmethod init-from-entity! ((this orb-cache-top) (arg0 entity-actor))
(let ((a0-1 (-> this entity)))
(if (when a0-1
(let ((a0-2 (-> a0-1 extra perm task)))
@@ -305,13 +298,13 @@
)
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
(backup-collide-with-as s4-0)
(set! (-> this root-override) s4-0)
(set! (-> this root) s4-0)
)
(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))
(update-transforms! (-> this root))
(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)
+48 -52
View File
@@ -8,35 +8,33 @@
;; DECOMP BEGINS
(deftype plat-button (process-drawable)
((root-override collide-shape-moving :offset 112)
(go-back-if-lost-player? symbol :offset-assert 176)
(grab-player? symbol :offset-assert 180)
(should-grab-player? symbol :offset-assert 184)
(path-pos float :offset-assert 188)
(bidirectional? symbol :offset-assert 192)
(allow-auto-kill symbol :offset-assert 196)
(sound-id sound-id :offset-assert 200)
(trans-off vector :inline :offset-assert 208)
(spawn-pos vector :inline :offset-assert 224)
((root collide-shape-moving :override)
(go-back-if-lost-player? symbol)
(grab-player? symbol)
(should-grab-player? symbol)
(path-pos float)
(bidirectional? symbol)
(allow-auto-kill symbol)
(sound-id sound-id)
(trans-off vector :inline)
(spawn-pos vector :inline)
)
:heap-base #x80
:method-count-assert 33
:size-assert #xf0
:flag-assert #x21008000f0
(:state-methods
plat-button-at-end
plat-button-idle
plat-button-pressed
plat-button-move-downward
plat-button-move-upward
plat-button-teleport-to-other-end
)
(:methods
(plat-button-at-end () _type_ :state 20)
(plat-button-idle () _type_ :state 21)
(plat-button-pressed () _type_ :state 22)
(plat-button-move-downward () _type_ :state 23)
(plat-button-move-upward () _type_ :state 24)
(plat-button-teleport-to-other-end () _type_ :state 25)
(can-activate? (_type_) symbol 26)
(plat-button-method-27 (_type_) none 27)
(plat-button-method-28 (_type_) collide-shape-moving 28)
(can-target-move? (_type_) none 29)
(should-teleport? (_type_) symbol 30)
(plat-button-method-31 (_type_) none 31)
(plat-button-method-32 (_type_) none 32)
(can-activate? (_type_) symbol)
(plat-button-method-27 (_type_) none)
(plat-button-method-28 (_type_) collide-shape-moving)
(can-target-move? (_type_) none)
(should-teleport? (_type_) symbol)
(plat-button-method-31 (_type_) none)
(plat-button-method-32 (_type_) none)
)
)
@@ -46,11 +44,11 @@
:bounds (static-spherem 0 -1 0 6.6)
)
(defmethod should-teleport? plat-button ((this plat-button))
(defmethod should-teleport? ((this plat-button))
#f
)
(defmethod can-activate? plat-button ((this plat-button))
(defmethod can-activate? ((this plat-button))
(or (= (-> this path-pos) 0.0) (and (-> this bidirectional?) (= (-> this path-pos) 1.0)))
)
@@ -62,7 +60,7 @@
(when (can-activate? self)
(if (and ((method-of-type touching-shapes-entry prims-touching?)
(the-as touching-shapes-entry (-> block param 0))
(-> self root-override)
(-> self root)
(the-as uint 1)
)
(or (not (-> self should-grab-player?)) (set! (-> self grab-player?) (process-grab? *target*)))
@@ -117,7 +115,7 @@
(let ((gp-0 (new 'stack-no-clear 'vector)))
(eval-path-curve! (-> self path) gp-0 f0-0 'interp)
(vector+! gp-0 gp-0 (-> self trans-off))
(move-to-point! (-> self root-override) gp-0)
(move-to-point! (-> self root) gp-0)
)
)
(ja-post)
@@ -201,18 +199,18 @@
(let ((gp-0 (new 'stack-no-clear 'vector)))
(eval-path-curve! (-> self path) gp-0 f0-4 'interp)
(vector+! gp-0 gp-0 (-> self trans-off))
(move-to-point! (-> self root-override) gp-0)
(move-to-point! (-> self root) gp-0)
)
)
(sound-play "elev-loop" :id (-> self sound-id))
(let ((gp-1 (the-as sound-rpc-set-param (get-sound-buffer-entry))))
(set! (-> gp-1 command) (sound-command set-param))
(set! (-> gp-1 id) (-> self sound-id))
(let ((a1-6 (-> self root-override trans)))
(let ((a1-6 (-> self root trans)))
(let ((s5-0 self))
(when (= a1-6 #t)
(if (and s5-0 (type-type? (-> s5-0 type) process-drawable) (nonzero? (-> s5-0 root-override)))
(set! a1-6 (-> s5-0 root-override trans))
(if (and s5-0 (type-type? (-> s5-0 type) process-drawable) (nonzero? (-> s5-0 root)))
(set! a1-6 (-> s5-0 root trans))
(set! a1-6 (the-as vector #f))
)
)
@@ -271,18 +269,18 @@
(let ((gp-0 (new 'stack-no-clear 'vector)))
(eval-path-curve! (-> self path) gp-0 f0-4 'interp)
(vector+! gp-0 gp-0 (-> self trans-off))
(move-to-point! (-> self root-override) gp-0)
(move-to-point! (-> self root) gp-0)
)
)
(sound-play "elev-loop" :id (-> self sound-id))
(let ((gp-1 (the-as sound-rpc-set-param (get-sound-buffer-entry))))
(set! (-> gp-1 command) (sound-command set-param))
(set! (-> gp-1 id) (-> self sound-id))
(let ((a1-6 (-> self root-override trans)))
(let ((a1-6 (-> self root trans)))
(let ((s5-0 self))
(when (= a1-6 #t)
(if (and s5-0 (type-type? (-> s5-0 type) process-drawable) (nonzero? (-> s5-0 root-override)))
(set! a1-6 (-> s5-0 root-override trans))
(if (and s5-0 (type-type? (-> s5-0 type) process-drawable) (nonzero? (-> s5-0 root)))
(set! a1-6 (-> s5-0 root trans))
(set! a1-6 (the-as vector #f))
)
)
@@ -309,9 +307,7 @@
(sound-stop (-> self sound-id))
(sound-play "elev-land")
(loop
(if (or (not *target*)
(< 268435460.0 (vector-vector-xz-distance-squared (-> self root-override trans) (target-pos 0)))
)
(if (or (not *target*) (< 268435460.0 (vector-vector-xz-distance-squared (-> self root trans) (target-pos 0))))
(go-virtual plat-button-idle)
)
(suspend)
@@ -319,7 +315,7 @@
)
)
(defmethod plat-button-method-28 plat-button ((this plat-button))
(defmethod plat-button-method-28 ((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)
@@ -355,17 +351,17 @@
)
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
(backup-collide-with-as s5-0)
(set! (-> this root-override) s5-0)
(set! (-> this root) s5-0)
s5-0
)
)
(defmethod can-target-move? plat-button ((this plat-button))
(defmethod can-target-move? ((this plat-button))
0
(none)
)
(defmethod plat-button-method-27 plat-button ((this plat-button))
(defmethod plat-button-method-27 ((this plat-button))
(ja-channel-set! 1)
(cond
((can-activate? this)
@@ -392,23 +388,23 @@
)
)
(ja-post)
(update-transforms! (-> this root-override))
(update-transforms! (-> this root))
(none)
)
(defmethod plat-button-method-31 plat-button ((this plat-button))
(defmethod plat-button-method-31 ((this plat-button))
(initialize-skeleton this *plat-button-sg* '())
0
(none)
)
(defmethod plat-button-method-32 plat-button ((this plat-button))
(defmethod plat-button-method-32 ((this plat-button))
(go (method-of-object this plat-button-idle))
0
(none)
)
(defmethod init-from-entity! plat-button ((this plat-button) (arg0 entity-actor))
(defmethod init-from-entity! ((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)
@@ -431,11 +427,11 @@
(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 spawn-pos quad) (-> this root 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)))
(let ((s5-1 (-> this root trans)))
(eval-path-curve! (-> this path) s5-1 (-> this path-pos) 'interp)
(vector+! s5-1 s5-1 (-> this trans-off))
)
+20 -24
View File
@@ -8,20 +8,16 @@
;; DECOMP BEGINS
(deftype plat-eco (plat)
((notice-dist float :offset-assert 264)
(sync-offset-dest float :offset-assert 268)
(sync-offset-faux float :offset-assert 272)
(sync-linear-val float :offset-assert 276)
(target handle :offset-assert 280)
(unlit-look lod-set :inline :offset-assert 288)
(lit-look lod-set :inline :offset-assert 324)
((notice-dist float)
(sync-offset-dest float)
(sync-offset-faux float)
(sync-linear-val float)
(target handle)
(unlit-look lod-set :inline)
(lit-look lod-set :inline)
)
:heap-base #x100
:method-count-assert 33
:size-assert #x165
:flag-assert #x2101000165
(:methods
(notice-blue (handle) _type_ :replace :state 29)
(notice-blue (handle) _type_ :state :overlay-at wad)
)
)
@@ -59,7 +55,7 @@
)
:trans (behavior ()
(when (and (and *target*
(>= (-> self notice-dist) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))
(>= (-> self notice-dist) (vector-vector-distance (-> self root trans) (-> *target* control trans)))
)
(send-event *target* 'query 'powerup (pickup-type eco-blue))
)
@@ -67,14 +63,14 @@
(go-virtual plat-path-active (the-as plat #f))
)
(if (and *target*
(>= (-> self notice-dist) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))
(>= (-> self notice-dist) (vector-vector-distance (-> self root trans) (-> *target* control trans)))
)
(level-hint-spawn (text-id misty-eco-plat) "sksp0073" (the-as entity #f) *entity-pool* (game-task none))
)
)
:code (behavior ()
(ja-post)
(update-transforms! (-> self root-override))
(update-transforms! (-> self root))
(anim-loop)
)
:post ja-post
@@ -85,7 +81,7 @@
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('wake)
(sound-play "blue-eco-on" :position (the-as symbol (-> self root-override trans)))
(sound-play "blue-eco-on" :position (the-as symbol (-> self root trans)))
(go-virtual plat-path-active (the-as plat #f))
)
(('ridden 'edge-grabbed)
@@ -128,7 +124,7 @@
)
)
(when v1-6
(let* ((s5-0 (-> self root-override root-prim prim-core))
(let* ((s5-0 (-> self root root-prim prim-core))
(a1-3 (-> (the-as collide-shape v1-6) root-prim prim-core))
(f30-0 (vector-vector-distance (the-as vector s5-0) (the-as vector a1-3)))
)
@@ -214,7 +210,7 @@
)
)
(defmethod baseplat-method-24 plat-eco ((this plat-eco))
(defmethod baseplat-method-24 ((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)
@@ -233,21 +229,21 @@
)
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
(backup-collide-with-as s5-0)
(set! (-> this root-override) s5-0)
(set! (-> this root) s5-0)
)
0
(none)
)
(defmethod get-unlit-skel plat-eco ((this plat-eco))
(defmethod get-unlit-skel ((this plat-eco))
*plat-eco-unlit-sg*
)
(defmethod get-lit-skel plat-eco ((this plat-eco))
(defmethod get-lit-skel ((this plat-eco))
*plat-eco-lit-sg*
)
(defmethod init-from-entity! plat-eco ((this plat-eco) (arg0 entity-actor))
(defmethod init-from-entity! ((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))
@@ -261,7 +257,7 @@
(setup-lods! (-> this lit-look) s5-1 (-> this draw art-group) (-> this entity))
)
(logclear! (-> this mask) (process-mask actor-pause))
(update-transforms! (-> this root-override))
(update-transforms! (-> this root))
(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))
@@ -274,7 +270,7 @@
(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)
(eval-path-curve! (-> this path) (-> this root trans) (-> this path-pos) 'interp)
(set! (-> this sound-id) (new-sound-id))
(baseplat-method-26 this)
(baseplat-method-21 this)
+20 -24
View File
@@ -55,21 +55,17 @@
)
(deftype plat (baseplat)
((path-pos float :offset-assert 228)
(sync sync-info-eased :inline :offset-assert 232)
(sound-id sound-id :offset-assert 260)
((path-pos float)
(sync sync-info-eased :inline)
(sound-id sound-id)
)
:heap-base #xa0
:method-count-assert 33
:size-assert #x108
:flag-assert #x2100a00108
(:methods
(get-lit-skel (_type_) skeleton-group 27)
(plat-method-28 () none 28)
(wad () _type_ :state 29)
(plat-startup (plat) _type_ :state 30)
(plat-idle () _type_ :state 31)
(plat-path-active (plat) _type_ :state 32)
(get-lit-skel (_type_) skeleton-group)
(plat-method-28 () none)
(wad () _type_ :state)
(plat-startup (plat) _type_ :state)
(plat-idle () _type_ :state)
(plat-path-active (plat) _type_ :state)
)
)
@@ -89,7 +85,7 @@
:bounds (static-spherem 0 -0.5 0 3.2)
)
(defmethod get-unlit-skel plat ((this plat))
(defmethod get-unlit-skel ((this plat))
(cond
((= (-> (if (-> this entity)
(-> this entity extra level)
@@ -126,7 +122,7 @@
)
)
(defmethod baseplat-method-24 plat ((this plat))
(defmethod baseplat-method-24 ((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)
@@ -145,18 +141,18 @@
)
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
(backup-collide-with-as s5-0)
(set! (-> this root-override) s5-0)
(set! (-> this root) s5-0)
)
0
(none)
)
(defmethod baseplat-method-26 plat ((this plat))
(defmethod baseplat-method-26 ((this plat))
0
(none)
)
(defmethod baseplat-method-25 plat ((this plat))
(defmethod baseplat-method-25 ((this plat))
(the-as sparticle-launch-group (when (!= (-> (if (-> this entity)
(-> this entity extra level)
(-> *level* level-default)
@@ -230,8 +226,8 @@
)
)
(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)))
(if (< (vector-vector-distance (-> self root trans) (ear-trans)) 81920.0)
(sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root trans)))
)
(plat-trans)
)
@@ -239,13 +235,13 @@
:post plat-post
)
(defmethod init-from-entity! plat ((this plat) (arg0 entity-actor))
(defmethod init-from-entity! ((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))
(update-transforms! (-> this root))
(baseplat-method-21 this)
(baseplat-method-25 this)
(load-params! (-> this sync) this (the-as uint 0) 0.0 0.15 0.15)
@@ -269,7 +265,7 @@
(get-current-phase-with-mirror (-> this sync))
)
)
(eval-path-curve! (-> this path) (-> this root-override trans) (-> this path-pos) 'interp)
(eval-path-curve! (-> this path) (-> this root trans) (-> this path-pos) 'interp)
(let ((a0-18 this))
(baseplat-method-26 a0-18)
(go (method-of-object this plat-startup) a0-18)
@@ -277,7 +273,7 @@
)
(else
(set! (-> this path-pos) 0.0)
(eval-path-curve! (-> this path) (-> this root-override trans) (-> this path-pos) 'interp)
(eval-path-curve! (-> this path) (-> this root trans) (-> this path-pos) 'interp)
(let ((a0-20 this))
(baseplat-method-26 a0-20)
(go (method-of-object this plat-startup) a0-20)
@@ -18,7 +18,7 @@
;; DECOMP BEGINS
(defmethod process-taskable-method-52 process-taskable ((this process-taskable))
(defmethod process-taskable-method-52 ((this process-taskable))
(let ((v1-1 (-> this draw shadow-ctrl)))
(when v1-1
(let ((a0-1 v1-1))
@@ -32,7 +32,7 @@
(none)
)
(defmethod init! gui-query ((this gui-query) (arg0 string) (arg1 int) (arg2 int) (arg3 int) (arg4 symbol) (arg5 string))
(defmethod init! ((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)
@@ -44,7 +44,7 @@
(none)
)
(defmethod get-response gui-query ((this gui-query))
(defmethod get-response ((this gui-query))
(kill-current-level-hint '() '(sidekick voicebox stinger) 'exit)
(level-hint-surpress!)
(hide-hud)
@@ -146,18 +146,15 @@
(-> this decision)
)
(defmethod relocate process-taskable ((this process-taskable) (arg0 int))
(defmethod relocate ((this process-taskable) (arg0 int))
(the-as process-taskable ((method-of-type process-drawable relocate) this arg0))
)
(defmethod process-taskable-method-46 process-taskable ((this process-taskable))
(defmethod process-taskable-method-46 ((this process-taskable))
(when (nonzero? (-> this sound-flava))
(let ((s5-1 (vector-!
(new 'stack-no-clear 'vector)
(target-pos 0)
(the-as vector (-> this root-override root-prim prim-core))
)
)
(let ((s5-1
(vector-! (new 'stack-no-clear 'vector) (target-pos 0) (the-as vector (-> this root root-prim prim-core)))
)
)
(set! (-> s5-1 y) (* 4.0 (-> s5-1 y)))
(cond
@@ -176,12 +173,9 @@
)
)
(when (-> this music)
(let ((s5-3 (vector-!
(new 'stack-no-clear 'vector)
(target-pos 0)
(the-as vector (-> this root-override root-prim prim-core))
)
)
(let ((s5-3
(vector-! (new 'stack-no-clear 'vector) (target-pos 0) (the-as vector (-> this root root-prim prim-core)))
)
)
(set! (-> s5-3 y) (* 4.0 (-> s5-3 y)))
(cond
@@ -202,18 +196,18 @@
(none)
)
(defmethod get-art-elem process-taskable ((this process-taskable))
(defmethod get-art-elem ((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 ((this process-taskable) (arg0 symbol))
(defmethod play-anim! ((this process-taskable) (arg0 symbol))
(the-as basic #f)
)
(defmethod process-taskable-method-33 process-taskable ((this process-taskable))
(defmethod process-taskable-method-33 ((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 this -99.0)
@@ -223,7 +217,7 @@
(none)
)
(defmethod close-anim-file! process-taskable ((this process-taskable))
(defmethod close-anim-file! ((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,11 +230,11 @@
)
)
(defmethod get-accept-anim process-taskable ((this process-taskable) (arg0 symbol))
(defmethod get-accept-anim ((this process-taskable) (arg0 symbol))
(the-as spool-anim #f)
)
(defmethod push-accept-anim process-taskable ((this process-taskable))
(defmethod push-accept-anim ((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 this -99.0)
@@ -250,11 +244,11 @@
(none)
)
(defmethod get-reject-anim process-taskable ((this process-taskable) (arg0 symbol))
(defmethod get-reject-anim ((this process-taskable) (arg0 symbol))
(the-as spool-anim #f)
)
(defmethod push-reject-anim process-taskable ((this process-taskable))
(defmethod push-reject-anim ((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 this -99.0)
@@ -264,7 +258,7 @@
(none)
)
(defmethod process-taskable-method-38 process-taskable ((this process-taskable))
(defmethod process-taskable-method-38 ((this process-taskable))
(if (nonzero? (-> this cell-for-task))
(go (method-of-object this give-cell))
)
@@ -344,9 +338,7 @@
)
:trans (behavior ()
(if (and (time-elapsed? (-> self state-time) (seconds 5))
(or (not *target*)
(< 20480.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))
)
(or (not *target*) (< 20480.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))))
)
(go-virtual idle)
)
@@ -628,7 +620,7 @@
(none)
)
(defmethod should-display? process-taskable ((this process-taskable))
(defmethod should-display? ((this process-taskable))
#t
)
@@ -655,7 +647,7 @@
)
0
(process-taskable-clean-up-after-talking)
(clear-collide-with-as (-> self root-override))
(clear-collide-with-as (-> self root))
(ja-channel-set! 0)
(the-as int (ja-post))
)
@@ -668,7 +660,7 @@
(else
(ja-channel-set! 1)
(ja :group! (get-art-elem self))
(restore-collide-with-as (-> self root-override))
(restore-collide-with-as (-> self root))
(process-entity-status! self (entity-perm-status bit-3) #t)
(let ((v1-7 (-> self draw shadow-ctrl)))
(logclear! (-> v1-7 settings flags) (shadow-flags disable-draw))
@@ -698,13 +690,11 @@
)
;; 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 ((this process-taskable))
(defmethod process-taskable-method-50 ((this process-taskable))
(if *target*
(or (not *target*)
(< 245760.0 (vector-vector-distance (-> this root-override trans) (-> *target* control trans)))
)
(or (not *target*) (< 245760.0 (vector-vector-distance (-> this root trans) (-> *target* control trans))))
(< 60397978000.0
(vector-vector-distance-squared (the-as vector (-> this root-override root-prim prim-core)) (camera-pos))
(vector-vector-distance-squared (the-as vector (-> this root root-prim prim-core)) (camera-pos))
)
)
)
@@ -784,7 +774,7 @@
(logior! (-> self mask) (process-mask actor-pause))
(let ((v1-6 (-> self entity extra trans)))
(if v1-6
(set! (-> self root-override trans quad) (-> v1-6 quad))
(set! (-> self root trans quad) (-> v1-6 quad))
)
)
(ja-channel-set! 0)
@@ -800,7 +790,7 @@
)
)
(defmethod target-above-threshold? process-taskable ((this process-taskable))
(defmethod target-above-threshold? ((this process-taskable))
#t
)
@@ -822,15 +812,10 @@
)
)
(('touch)
(the-as symbol (send-shove-back
(-> self root-override)
proc
(the-as touching-shapes-entry (-> block param 0))
0.7
6144.0
16384.0
)
)
(the-as
symbol
(send-shove-back (-> self root) proc (the-as touching-shapes-entry (-> block param 0)) 0.7 6144.0 16384.0)
)
)
(('clone)
(the-as symbol (go-virtual be-clone (the-as handle (-> block param 0))))
@@ -887,11 +872,9 @@
(not (logtest? (-> *target* control status) (cshape-moving-flags onsurf)))
)
)
(< (-> (target-pos 0) y) (+ 8192.0 (-> self root-override root-prim prim-core world-sphere y)))
(< (-> (target-pos 0) y) (+ 8192.0 (-> self root 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
)
(less-than-hack (vector-vector-distance (target-pos 0) (the-as vector (-> self root root-prim prim-core))) 32768.0)
(= (-> *level* loading-level) (-> *level* level-default))
(not (movie?))
(not (level-hint-displayed?))
@@ -972,7 +955,7 @@
)
)
(defmethod initialize-collision process-taskable ((this process-taskable) (arg0 int) (arg1 vector))
(defmethod initialize-collision ((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))
@@ -985,13 +968,13 @@
)
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
(backup-collide-with-as s5-0)
(set! (-> this root-override) s5-0)
(set! (-> this root) s5-0)
)
0
(none)
)
(defmethod process-taskable-method-40 process-taskable ((this process-taskable) (arg0 object) (arg1 skeleton-group) (arg2 int) (arg3 int) (arg4 vector) (arg5 int))
(defmethod process-taskable-method-40 ((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))
@@ -1001,7 +984,7 @@
;; og:preserve-this
(#when PC_PORT
(set! (-> this skel postbind-function) process-drawable-joint-callback-pc))
(set! (-> this root-override pause-adjust-distance) -122880.0)
(set! (-> this root 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))
@@ -1029,7 +1012,7 @@
(none)
)
(defmethod process-taskable-method-42 process-taskable ((this process-taskable))
(defmethod process-taskable-method-42 ((this process-taskable))
(cond
((not (should-display? this))
(go (method-of-object this hidden))
@@ -1044,17 +1027,17 @@
(none)
)
(defmethod process-taskable-method-43 process-taskable ((this process-taskable))
(defmethod process-taskable-method-43 ((this process-taskable))
(the-as symbol 0)
)
(defmethod ambient-control-method-9 ambient-control ((this ambient-control))
(defmethod ambient-control-method-9 ((this ambient-control))
(set! (-> this last-ambient-time) (-> *display* game-frame-counter))
0
(none)
)
(defmethod ambient-control-method-10 ambient-control ((this ambient-control) (arg0 vector) (arg1 time-frame) (arg2 float) (arg3 process-drawable))
(defmethod ambient-control-method-10 ((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)
@@ -1068,7 +1051,7 @@
arg0
)
(defmethod play-ambient ambient-control ((this ambient-control) (arg0 string) (arg1 symbol) (arg2 vector))
(defmethod play-ambient ((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))
@@ -1174,7 +1157,7 @@
(format #t "ERROR<GMJ>: othercam parent invalid~%")
(deactivate self)
)
(set! (-> *camera-other-root* quad) (-> (the-as process-taskable s2-0) root-override trans quad))
(set! (-> *camera-other-root* quad) (-> (the-as process-taskable s2-0) root trans quad))
(let ((s4-0 (-> (the-as process-taskable s2-0) node-list data (-> self cam-joint-index) bone transform))
(s3-0 (-> (the-as process-taskable s2-0) node-list data (-> self cam-joint-index) bone scale))
(gp-0 (new 'stack-no-clear 'vector))
@@ -1254,7 +1237,7 @@
(none)
)
(defmethod draw-npc-shadow process-taskable ((this process-taskable))
(defmethod draw-npc-shadow ((this process-taskable))
(let ((gp-0 (-> this draw shadow-ctrl)))
(cond
((and (-> this draw shadow)
+36 -42
View File
@@ -8,54 +8,48 @@
;; DECOMP BEGINS
(deftype rigid-body (structure)
((mass float :offset-assert 0)
(inv-mass float :offset-assert 4)
(lin-momentum-damping-factor float :offset-assert 8)
(ang-momentum-damping-factor float :offset-assert 12)
(inertial-tensor matrix :inline :offset-assert 16)
(inv-inertial-tensor matrix :inline :offset-assert 80)
(cm-offset-joint vector :inline :offset-assert 144)
(position vector :inline :offset-assert 160)
(rotation quaternion :inline :offset-assert 176)
(lin-momentum vector :inline :offset-assert 192)
(ang-momentum vector :inline :offset-assert 208)
(lin-velocity vector :inline :offset-assert 224)
(ang-velocity vector :inline :offset-assert 240)
(inv-i-world matrix :inline :offset-assert 256)
(matrix matrix :inline :offset-assert 320)
(force vector :inline :offset-assert 384)
(torque vector :inline :offset-assert 400)
(max-ang-momentum float :offset-assert 416)
(max-ang-velocity float :offset-assert 420)
((mass float)
(inv-mass float)
(lin-momentum-damping-factor float)
(ang-momentum-damping-factor float)
(inertial-tensor matrix :inline)
(inv-inertial-tensor matrix :inline)
(cm-offset-joint vector :inline)
(position vector :inline)
(rotation quaternion :inline)
(lin-momentum vector :inline)
(ang-momentum vector :inline)
(lin-velocity vector :inline)
(ang-velocity vector :inline)
(inv-i-world matrix :inline)
(matrix matrix :inline)
(force vector :inline)
(torque vector :inline)
(max-ang-momentum float)
(max-ang-velocity float)
)
:method-count-assert 23
:size-assert #x1a8
:flag-assert #x17000001a8
(:methods
(rigid-body-method-9 (_type_ float float float float) none 9)
(rigid-body-method-10 (_type_ float) none 10)
(clear-force-torque! (_type_) none 11)
(clear-momentum! (_type_) none 12)
(rigid-body-method-13 (_type_ vector vector) none 13)
(rigid-body-method-14 (_type_ vector vector) none 14)
(rigid-body-method-15 (_type_ vector) none 15)
(rigid-body-method-16 (_type_ vector vector float) none 16)
(rigid-body-method-17 (_type_ vector vector) vector 17)
(rigid-body-method-18 (_type_ vector) vector 18)
(print-stats (_type_) none 19)
(rigid-body-method-20 (_type_) none 20)
(rigid-body-method-21 (_type_) none 21)
(rigid-body-method-22 (_type_ vector quaternion float float) none 22)
(rigid-body-method-9 (_type_ float float float float) none)
(rigid-body-method-10 (_type_ float) none)
(clear-force-torque! (_type_) none)
(clear-momentum! (_type_) none)
(rigid-body-method-13 (_type_ vector vector) none)
(rigid-body-method-14 (_type_ vector vector) none)
(rigid-body-method-15 (_type_ vector) none)
(rigid-body-method-16 (_type_ vector vector float) none)
(rigid-body-method-17 (_type_ vector vector) vector)
(rigid-body-method-18 (_type_ vector) vector)
(print-stats (_type_) none)
(rigid-body-method-20 (_type_) none)
(rigid-body-method-21 (_type_) none)
(rigid-body-method-22 (_type_ vector quaternion float float) none)
)
)
(deftype rigid-body-control-point (structure)
((local-pos vector :inline :offset-assert 0)
(world-pos vector :inline :offset-assert 16)
(velocity vector :inline :offset-assert 32)
((local-pos vector :inline)
(world-pos vector :inline)
(velocity vector :inline)
)
:method-count-assert 9
:size-assert #x30
:flag-assert #x900000030
)
+86 -94
View File
@@ -8,28 +8,28 @@
;; DECOMP BEGINS
(defmethod clear-force-torque! rigid-body ((this rigid-body))
(defmethod clear-force-torque! ((this rigid-body))
(set! (-> this force quad) (-> *null-vector* quad))
(set! (-> this torque quad) (-> *null-vector* quad))
0
(none)
)
(defmethod clear-momentum! rigid-body ((this rigid-body))
(defmethod clear-momentum! ((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 ((this rigid-body))
(defmethod rigid-body-method-21 ((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 ((this rigid-body) (arg0 vector) (arg1 quaternion) (arg2 float) (arg3 float))
(defmethod rigid-body-method-22 ((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))
@@ -50,7 +50,7 @@
(none)
)
(defmethod rigid-body-method-9 rigid-body ((this rigid-body) (arg0 float) (arg1 float) (arg2 float) (arg3 float))
(defmethod rigid-body-method-9 ((this rigid-body) (arg0 float) (arg1 float) (arg2 float) (arg3 float))
(set! (-> this mass) arg0)
(let ((f0-1 arg0))
(set! (-> this inv-mass) (/ 1.0 f0-1))
@@ -93,7 +93,7 @@
(none)
)
(defmethod rigid-body-method-17 rigid-body ((this rigid-body) (arg0 vector) (arg1 vector))
(defmethod rigid-body-method-17 ((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)
)
@@ -120,7 +120,7 @@
arg0
)
(defmethod rigid-body-method-10 rigid-body ((this rigid-body) (arg0 float))
(defmethod rigid-body-method-10 ((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))
@@ -147,7 +147,7 @@
(none)
)
(defmethod rigid-body-method-13 rigid-body ((this rigid-body) (arg0 vector) (arg1 vector))
(defmethod rigid-body-method-13 ((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))
@@ -158,7 +158,7 @@
(none)
)
(defmethod rigid-body-method-16 rigid-body ((this rigid-body) (arg0 vector) (arg1 vector) (arg2 float))
(defmethod rigid-body-method-16 ((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))
@@ -174,7 +174,7 @@
(none)
)
(defmethod rigid-body-method-14 rigid-body ((this rigid-body) (arg0 vector) (arg1 vector))
(defmethod rigid-body-method-14 ((this rigid-body) (arg0 vector) (arg1 vector))
(let ((s5-0 (new 'stack-no-clear 'vector))
(s4-0 (new 'stack-no-clear 'vector))
)
@@ -187,13 +187,13 @@
(none)
)
(defmethod rigid-body-method-15 rigid-body ((this rigid-body) (arg0 vector))
(defmethod rigid-body-method-15 ((this rigid-body) (arg0 vector))
(vector+! (-> this force) (-> this force) arg0)
0
(none)
)
(defmethod rigid-body-method-18 rigid-body ((this rigid-body) (arg0 vector))
(defmethod rigid-body-method-18 ((this rigid-body) (arg0 vector))
(let ((gp-0 (new 'stack-no-clear 'vector)))
(vector-rotate*! gp-0 (-> this cm-offset-joint) (-> this matrix))
(vector-! arg0 (-> this position) gp-0)
@@ -201,7 +201,7 @@
arg0
)
(defmethod print-stats rigid-body ((this rigid-body))
(defmethod print-stats ((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))
@@ -221,7 +221,7 @@
(none)
)
(defmethod rigid-body-method-20 rigid-body ((this rigid-body))
(defmethod rigid-body-method-20 ((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
@@ -229,91 +229,83 @@
)
(deftype rigid-body-platform-constants (structure)
((drag-factor float :offset-assert 0)
(buoyancy-factor float :offset-assert 4)
(max-buoyancy-depth meters :offset-assert 8)
(gravity-factor float :offset-assert 12)
(gravity meters :offset-assert 16)
(player-weight meters :offset-assert 20)
(player-bonk-factor float :offset-assert 24)
(player-dive-factor float :offset-assert 28)
(player-force-distance meters :offset-assert 32)
(player-force-clamp meters :offset-assert 36)
(player-force-timeout time-frame :offset-assert 40)
(explosion-force meters :offset-assert 48)
(linear-damping float :offset-assert 52)
(angular-damping float :offset-assert 56)
(control-point-count int32 :offset-assert 60)
(mass float :offset-assert 64)
(inertial-tensor-x meters :offset-assert 68)
(inertial-tensor-y meters :offset-assert 72)
(inertial-tensor-z meters :offset-assert 76)
(cm-joint-x meters :offset-assert 80)
(cm-joint-y meters :offset-assert 84)
(cm-joint-z meters :offset-assert 88)
(idle-distance meters :offset-assert 92)
(platform symbol :offset-assert 96)
(sound-name string :offset-assert 100)
((drag-factor float)
(buoyancy-factor float)
(max-buoyancy-depth meters)
(gravity-factor float)
(gravity meters)
(player-weight meters)
(player-bonk-factor float)
(player-dive-factor float)
(player-force-distance meters)
(player-force-clamp meters)
(player-force-timeout time-frame)
(explosion-force meters)
(linear-damping float)
(angular-damping float)
(control-point-count int32)
(mass float)
(inertial-tensor-x meters)
(inertial-tensor-y meters)
(inertial-tensor-z meters)
(cm-joint-x meters)
(cm-joint-y meters)
(cm-joint-z meters)
(idle-distance meters)
(platform symbol)
(sound-name string)
)
:method-count-assert 9
:size-assert #x68
:flag-assert #x900000068
)
(deftype rigid-body-control-point-inline-array (inline-array-class)
((data rigid-body-control-point :inline :dynamic :offset 16)
((data rigid-body-control-point :inline :dynamic :offset 16)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
(set! (-> rigid-body-control-point-inline-array heap-base) (the-as uint 48))
(deftype rigid-body-platform (process-drawable)
((root-overlay collide-shape-moving :offset 112)
(info rigid-body-platform-constants :offset-assert 176)
(rbody rigid-body :inline :offset-assert 192)
(control-point-array rigid-body-control-point-inline-array :offset-assert 616)
(player-velocity vector :inline :offset-assert 624)
(player-velocity-prev vector :inline :offset-assert 640)
(player-force-position vector :inline :offset-assert 656)
(player-force vector :inline :offset-assert 672)
(sim-time-remaining float :offset-assert 688)
(float-height-offset float :offset-assert 692)
(player-attack-id int32 :offset-assert 696)
(player-bonk-timeout time-frame :offset-assert 704)
(water-anim water-anim :offset-assert 712)
(player-contact basic :offset-assert 716)
(player-impulse collide-shape-prim-mesh :offset-assert 720)
((root-overlay collide-shape-moving :overlay-at root)
(info rigid-body-platform-constants)
(rbody rigid-body :inline)
(control-point-array rigid-body-control-point-inline-array)
(player-velocity vector :inline)
(player-velocity-prev vector :inline)
(player-force-position vector :inline)
(player-force vector :inline)
(sim-time-remaining float)
(float-height-offset float)
(player-attack-id int32)
(player-bonk-timeout time-frame)
(water-anim water-anim)
(player-contact basic)
(player-impulse collide-shape-prim-mesh)
)
:heap-base #x270
:method-count-assert 35
:size-assert #x2d4
:flag-assert #x23027002d4
(:state-methods
rigid-body-platform-idle
rigid-body-platform-float
)
(:methods
(rigid-body-platform-idle () _type_ :state 20)
(rigid-body-platform-float () _type_ :state 21)
(rigid-body-platform-method-22 (_type_ vector float) float 22)
(rigid-body-platform-method-23 (_type_ float) none 23)
(rigid-body-platform-method-24 (_type_ rigid-body-control-point float) none 24)
(rigid-body-platform-method-25 (_type_) none 25)
(rigid-body-platform-method-26 (_type_) none 26)
(rigid-body-platform-method-27 (_type_ vector) none 27)
(rigid-body-platform-method-28 (_type_) none 28)
(rigid-body-platform-method-29 (_type_ rigid-body-platform-constants) none 29)
(rigid-body-platform-method-30 (_type_) none 30)
(rigid-body-platform-method-31 (_type_) none 31)
(rigid-body-platform-method-32 (_type_) sound-id 32)
(rigid-body-platform-method-33 (_type_) object 33)
(rigid-body-platform-method-34 (_type_) none 34)
(rigid-body-platform-method-22 (_type_ vector float) float)
(rigid-body-platform-method-23 (_type_ float) none)
(rigid-body-platform-method-24 (_type_ rigid-body-control-point float) none)
(rigid-body-platform-method-25 (_type_) none)
(rigid-body-platform-method-26 (_type_) none)
(rigid-body-platform-method-27 (_type_ vector) none)
(rigid-body-platform-method-28 (_type_) none)
(rigid-body-platform-method-29 (_type_ rigid-body-platform-constants) none)
(rigid-body-platform-method-30 (_type_) none)
(rigid-body-platform-method-31 (_type_) none)
(rigid-body-platform-method-32 (_type_) sound-id)
(rigid-body-platform-method-33 (_type_) object)
(rigid-body-platform-method-34 (_type_) none)
)
)
(defmethod relocate rigid-body-platform ((this rigid-body-platform) (arg0 int))
(defmethod relocate ((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))
@@ -322,7 +314,7 @@
(call-parent-method this arg0)
)
(defmethod rigid-body-platform-method-22 rigid-body-platform ((this rigid-body-platform) (arg0 vector) (arg1 float))
(defmethod rigid-body-platform-method-22 ((this rigid-body-platform) (arg0 vector) (arg1 float))
(let ((v1-0 (-> this water-anim)))
0.0
(+ (the-as float (cond
@@ -349,7 +341,7 @@
)
)
(defmethod rigid-body-platform-method-24 rigid-body-platform ((this rigid-body-platform) (arg0 rigid-body-control-point) (arg1 float))
(defmethod rigid-body-platform-method-24 ((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)))
@@ -373,7 +365,7 @@
(none)
)
(defmethod rigid-body-platform-method-25 rigid-body-platform ((this rigid-body-platform))
(defmethod rigid-body-platform-method-25 ((this rigid-body-platform))
(when (or (-> this player-impulse) (-> this player-contact))
(set! (-> this player-impulse) #f)
(rigid-body-method-16
@@ -387,7 +379,7 @@
(none)
)
(defmethod rigid-body-platform-method-26 rigid-body-platform ((this rigid-body-platform))
(defmethod rigid-body-platform-method-26 ((this rigid-body-platform))
(let ((a1-0 (new 'stack-no-clear 'vector)))
(vector-float*!
a1-0
@@ -400,7 +392,7 @@
(none)
)
(defmethod rigid-body-platform-method-27 rigid-body-platform ((this rigid-body-platform) (arg0 vector))
(defmethod rigid-body-platform-method-27 ((this rigid-body-platform) (arg0 vector))
(let ((gp-0 (new 'stack-no-clear 'vector)))
(vector-! gp-0 arg0 (-> this rbody position))
(set! (-> gp-0 y) 0.0)
@@ -417,7 +409,7 @@
(none)
)
(defmethod rigid-body-platform-method-23 rigid-body-platform ((this rigid-body-platform) (arg0 float))
(defmethod rigid-body-platform-method-23 ((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)))
@@ -433,7 +425,7 @@
(none)
)
(defmethod rigid-body-platform-method-28 rigid-body-platform ((this rigid-body-platform))
(defmethod rigid-body-platform-method-28 ((this rigid-body-platform))
(if (-> this info platform)
(detect-riders! (-> this root-overlay))
)
@@ -446,7 +438,7 @@
(* 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)))))
(f28-0 (* 0.0033333334 (the float (logand #xffffff (current-time)))))
)
(while (>= (-> this sim-time-remaining) (* 0.5 f30-0))
(clear-force-torque! (-> this rbody))
@@ -643,7 +635,7 @@
:post rigid-body-platform-post
)
(defmethod rigid-body-platform-method-29 rigid-body-platform ((this rigid-body-platform) (arg0 rigid-body-platform-constants))
(defmethod rigid-body-platform-method-29 ((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))
@@ -682,7 +674,7 @@
(none)
)
(defmethod rigid-body-platform-method-30 rigid-body-platform ((this rigid-body-platform))
(defmethod rigid-body-platform-method-30 ((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)
@@ -733,13 +725,13 @@
)
)
(defmethod rigid-body-platform-method-34 rigid-body-platform ((this rigid-body-platform))
(defmethod rigid-body-platform-method-34 ((this rigid-body-platform))
(go (method-of-object this rigid-body-platform-idle))
0
(none)
)
(defmethod rigid-body-platform-method-31 rigid-body-platform ((this rigid-body-platform))
(defmethod rigid-body-platform-method-31 ((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)))
@@ -758,7 +750,7 @@
(none)
)
(defmethod init-from-entity! rigid-body-platform ((this rigid-body-platform) (arg0 entity-actor))
(defmethod init-from-entity! ((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)
+64 -74
View File
@@ -8,29 +8,26 @@
;; DECOMP BEGINS
(deftype ropebridge-tuning (structure)
((num-springs int32 :offset-assert 0)
(num-spring-points int32 :offset-assert 4)
(col-mesh-indexes (pointer uint8) :offset-assert 8)
(view-frustum-radius float :offset-assert 12)
(root-prim-radius float :offset-assert 16)
(desired-spring-len float :offset-assert 20)
(gravity float :offset-assert 24)
(spring-coefficient float :offset-assert 28)
(spring-mass float :offset-assert 32)
(friction float :offset-assert 36)
(max-influence-dist float :offset-assert 40)
(rider-max-gravity float :offset-assert 44)
(max-bonk-influence-dist float :offset-assert 48)
(rider-bonk-force float :offset-assert 52)
(rider-bonk-min float :offset-assert 56)
(rider-bonk-max float :offset-assert 60)
(normal-board-len float :offset-assert 64)
(bridge-end-to-end-len float :offset-assert 68)
(rest-state symbol :offset-assert 72)
((num-springs int32)
(num-spring-points int32)
(col-mesh-indexes (pointer uint8))
(view-frustum-radius float)
(root-prim-radius float)
(desired-spring-len float)
(gravity float)
(spring-coefficient float)
(spring-mass float)
(friction float)
(max-influence-dist float)
(rider-max-gravity float)
(max-bonk-influence-dist float)
(rider-bonk-force float)
(rider-bonk-min float)
(rider-bonk-max float)
(normal-board-len float)
(bridge-end-to-end-len float)
(rest-state symbol)
)
:method-count-assert 9
:size-assert #x4c
:flag-assert #x90000004c
)
@@ -458,47 +455,40 @@
)
(deftype ropebridge-spring-point (structure)
((local-pos vector :inline :offset-assert 0)
(vel vector :inline :offset-assert 16)
(extra-force vector :inline :offset-assert 32)
((local-pos vector :inline)
(vel vector :inline)
(extra-force vector :inline)
)
:pack-me
:method-count-assert 9
:size-assert #x30
:flag-assert #x900000030
)
(deftype ropebridge (process-drawable)
((root-override collide-shape :offset 112)
(subtype uint64 :offset-assert 176)
(subtype-name string :offset-assert 184)
(agitated-time-stamp time-frame :offset-assert 192)
(bonk-time-stamp time-frame :offset-assert 200)
(attack-flop-time-stamp time-frame :offset-assert 208)
(player-attack-id uint64 :offset-assert 216)
(sleep-dist float :offset-assert 224)
(do-physics? basic :offset-assert 228)
(tuning ropebridge-tuning :offset-assert 232)
(world-matrix matrix :inline :offset-assert 240)
(inv-world-matrix matrix :inline :offset-assert 304)
(extra-trans vector :inline :offset-assert 368)
(spring-point ropebridge-spring-point 36 :inline :offset-assert 384)
((root collide-shape :override)
(subtype uint64)
(subtype-name string)
(agitated-time-stamp time-frame)
(bonk-time-stamp time-frame)
(attack-flop-time-stamp time-frame)
(player-attack-id uint64)
(sleep-dist float)
(do-physics? basic)
(tuning ropebridge-tuning)
(world-matrix matrix :inline)
(inv-world-matrix matrix :inline)
(extra-trans vector :inline)
(spring-point ropebridge-spring-point 36 :inline)
)
:heap-base #x7d0
:method-count-assert 29
:size-assert #x840
:flag-assert #x1d07d00840
(:methods
(set-vel-from-impact (_type_ uint vector int float) none 20)
(set-vel-from-riders (_type_) none 21)
(set-vel-from-rider (_type_ uint vector int) none 22)
(clear-spring-forces (_type_) none 23)
(debug-draw (_type_) none 24)
(set-to-rest-state (_type_) none 25)
(add-collision-meshes (_type_) none 26)
(do-integration (_type_) none 27)
(ropebridge-method-28 (_type_) none 28)
(set-vel-from-impact (_type_ uint vector int float) none)
(set-vel-from-riders (_type_) none)
(set-vel-from-rider (_type_ uint vector int) none)
(clear-spring-forces (_type_) none)
(debug-draw (_type_) none)
(set-to-rest-state (_type_) none)
(add-collision-meshes (_type_) none)
(do-integration (_type_) none)
(ropebridge-method-28 (_type_) none)
)
(:states
ropebridge-idle
@@ -573,7 +563,7 @@
)
(gp-0 (the-as object (-> block param 0)))
(a0-7 (-> (the-as touching-shapes-entry gp-0) head))
(s4-0 (-> self root-override))
(s4-0 (-> self root))
(s5-0 (get-touched-prim a0-7 s4-0 (the-as touching-shapes-entry gp-0)))
(v1-33 ((method-of-type touching-shapes-entry get-touched-shape) (the-as touching-shapes-entry gp-0) s4-0))
(gp-1 (new 'stack-no-clear 'vector))
@@ -594,7 +584,7 @@
:code (behavior ()
(loop
(suspend)
(detect-riders! (-> self root-override))
(detect-riders! (-> self root))
(when (-> self do-physics?)
(clear-spring-forces self)
(set-vel-from-riders self)
@@ -618,7 +608,7 @@
)
:post (behavior ()
(ja-post)
(let ((gp-0 (-> self root-override)))
(let ((gp-0 (-> self root)))
(update-transforms! gp-0)
(when (-> self do-physics?)
(pull-riders! gp-0)
@@ -630,7 +620,7 @@
)
;; 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 ((this ropebridge) (arg0 uint) (arg1 vector) (arg2 int) (arg3 float))
(defmethod set-vel-from-impact ((this ropebridge) (arg0 uint) (arg1 vector) (arg2 int) (arg3 float))
(loop
(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)
@@ -653,7 +643,7 @@
(none)
)
(defmethod clear-spring-forces ropebridge ((this ropebridge))
(defmethod clear-spring-forces ((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))
@@ -665,8 +655,8 @@
(none)
)
(defmethod set-vel-from-riders ropebridge ((this ropebridge))
(let ((v1-1 (-> this root-override riders)))
(defmethod set-vel-from-riders ((this ropebridge))
(let ((v1-1 (-> this root riders)))
(when v1-1
(let ((s5-0 (the-as collide-sticky-rider (-> v1-1 rider))))
(countdown (s4-0 (-> v1-1 num-riders))
@@ -697,7 +687,7 @@
)
;; 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 ((this ropebridge) (arg0 uint) (arg1 vector) (arg2 int))
(defmethod set-vel-from-rider ((this ropebridge) (arg0 uint) (arg1 vector) (arg2 int))
(loop
(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)
@@ -718,7 +708,7 @@
(none)
)
(defmethod do-integration ropebridge ((this ropebridge))
(defmethod do-integration ((this ropebridge))
(local-vars (a2-1 float) (a3-0 float))
(rlet ((Q :class vf)
(vf0 :class vf)
@@ -841,7 +831,7 @@
)
)
(defmethod debug-draw ropebridge ((this ropebridge))
(defmethod debug-draw ((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))
@@ -855,7 +845,7 @@
(none)
)
(defmethod set-to-rest-state ropebridge ((this ropebridge))
(defmethod set-to-rest-state ((this ropebridge))
(rlet ((vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
@@ -940,8 +930,8 @@
(none)
)
(defmethod add-collision-meshes ropebridge ((this ropebridge))
(let* ((s5-0 (-> this root-override))
(defmethod add-collision-meshes ((this ropebridge))
(let* ((s5-0 (-> this root))
(s3-0 (-> this tuning))
(s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint (-> s3-0 num-springs)) 0))
)
@@ -970,22 +960,22 @@
(none)
)
(defmethod run-logic? ropebridge ((this ropebridge))
(defmethod run-logic? ((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)))
(or (>= (-> this sleep-dist) (vector-vector-distance (-> this root 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 ((this ropebridge))
(defmethod ropebridge-method-28 ((this ropebridge))
0
(none)
)
(defmethod init-from-entity! ropebridge ((this ropebridge) (arg0 entity-actor))
(defmethod init-from-entity! ((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")
@@ -1027,7 +1017,7 @@
(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)
(set! (-> this root) a0-13)
(alloc-riders a0-13 3)
)
(add-collision-meshes this)
@@ -1044,7 +1034,7 @@
(set! (-> this skel postbind-function) ropebridge-joint-callback)
(matrix<-transformq+trans!
(-> this world-matrix)
(the-as transformq (-> this root-override trans))
(the-as transformq (-> this root trans))
(-> this extra-trans)
)
(matrix-4x4-inverse! (-> this inv-world-matrix) (-> this world-matrix))
+23 -27
View File
@@ -33,26 +33,22 @@
)
(deftype sharkey (nav-enemy)
((dir vector :inline :offset-assert 400)
(spawn-point vector :inline :offset-assert 416)
(scale float :offset-assert 432)
(anim-speed float :offset-assert 436)
(y-max meters :offset-assert 440)
(y-min meters :offset-assert 444)
(attack-time float :offset-assert 448)
(player-water-time time-frame :offset-assert 456)
(player-in-water basic :offset-assert 464)
(last-y float :offset-assert 468)
(spawn-distance meters :offset-assert 472)
(chase-speed meters :offset-assert 476)
(y-speed meters :offset-assert 480)
(sound-id sound-id :offset-assert 484)
(enable-patrol basic :offset-assert 488)
((dir vector :inline)
(spawn-point vector :inline)
(scale float)
(anim-speed float)
(y-max meters)
(y-min meters)
(attack-time float)
(player-water-time time-frame)
(player-in-water basic)
(last-y float)
(spawn-distance meters)
(chase-speed meters)
(y-speed meters)
(sound-id sound-id)
(enable-patrol basic)
)
:heap-base #x180
:method-count-assert 76
:size-assert #x1ec
:flag-assert #x4c018001ec
)
@@ -61,17 +57,17 @@
:bounds (static-spherem 0 0 0 6)
)
(defmethod touch-handler sharkey ((this sharkey) (arg0 process) (arg1 event-message-block))
(defmethod touch-handler ((this sharkey) (arg0 process) (arg1 event-message-block))
#t
)
(defmethod attack-handler sharkey ((this sharkey) (arg0 process) (arg1 event-message-block))
(defmethod attack-handler ((this sharkey) (arg0 process) (arg1 event-message-block))
#t
)
nav-enemy-default-event-handler
(defmethod run-logic? sharkey ((this sharkey))
(defmethod run-logic? ((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))
@@ -82,7 +78,7 @@ nav-enemy-default-event-handler
)
)
(defmethod nav-enemy-method-40 sharkey ((this sharkey))
(defmethod nav-enemy-method-40 ((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))
@@ -93,7 +89,7 @@ nav-enemy-default-event-handler
(none)
)
(defmethod nav-enemy-method-37 sharkey ((this sharkey))
(defmethod nav-enemy-method-37 ((this sharkey))
(let ((s5-0 (new 'stack-no-clear 'vector)))
(when (< 8192.0 (vector-length (-> this nav travel)))
(vector-normalize-copy! s5-0 (-> this nav travel) 1.0)
@@ -106,7 +102,7 @@ nav-enemy-default-event-handler
(none)
)
(defmethod nav-enemy-method-41 sharkey ((this sharkey))
(defmethod nav-enemy-method-41 ((this sharkey))
(let* ((f0-1 (- (-> this target-speed) (-> this momentum-speed)))
(f1-3 (fmin (* (-> this acceleration) (seconds-per-frame)) (fabs f0-1)))
)
@@ -127,7 +123,7 @@ nav-enemy-default-event-handler
(none)
)
(defmethod common-post sharkey ((this sharkey))
(defmethod common-post ((this sharkey))
(let ((f30-0 (-> this water height))
(s5-0 (new 'stack-no-clear 'vector))
)
@@ -600,7 +596,7 @@ nav-enemy-default-event-handler
)
)
(defmethod init-from-entity! sharkey ((this sharkey) (arg0 entity-actor))
(defmethod init-from-entity! ((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))
+10 -13
View File
@@ -8,23 +8,20 @@
;; DECOMP BEGINS
(deftype ticky (structure)
((delay-til-ramp time-frame :offset-assert 0)
(delay-til-timeout time-frame :offset-assert 8)
(starting-time time-frame :offset-assert 16)
(last-tick-time time-frame :offset-assert 24)
((delay-til-ramp time-frame)
(delay-til-timeout time-frame)
(starting-time time-frame)
(last-tick-time time-frame)
)
:method-count-assert 12
:size-assert #x20
:flag-assert #xc00000020
(:methods
(sleep (_type_ time-frame) none 9)
(reached-delay? (_type_ time-frame) symbol 10)
(completed? (_type_) symbol 11)
(sleep (_type_ time-frame) none)
(reached-delay? (_type_ time-frame) symbol)
(completed? (_type_) symbol)
)
)
(defmethod sleep ticky ((this ticky) (arg0 time-frame))
(defmethod sleep ((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))))
@@ -33,7 +30,7 @@
(none)
)
(defmethod completed? ticky ((this ticky))
(defmethod completed? ((this ticky))
(let ((gp-0 #f))
(let ((v1-2 (- (current-time) (-> this starting-time))))
(cond
@@ -60,6 +57,6 @@
)
)
(defmethod reached-delay? ticky ((this ticky) (arg0 time-frame))
(defmethod reached-delay? ((this ticky) (arg0 time-frame))
(time-elapsed? (-> this starting-time) arg0)
)
+10 -13
View File
@@ -8,24 +8,21 @@
;; DECOMP BEGINS
(deftype tippy (structure)
((axis vector :inline :offset-assert 0)
(angle float :offset-assert 16)
(orig quaternion :inline :offset-assert 32)
(dist-ratio float :offset-assert 48)
(damping float :offset-assert 52)
(1-damping float :offset-assert 56)
((axis vector :inline)
(angle float)
(orig quaternion :inline)
(dist-ratio float)
(damping float)
(1-damping float)
)
:method-count-assert 11
:size-assert #x3c
:flag-assert #xb0000003c
(:methods
(reset! (_type_ process-drawable float float) none 9)
(tippy-method-10 (_type_ process-drawable vector) symbol 10)
(reset! (_type_ process-drawable float float) none)
(tippy-method-10 (_type_ process-drawable vector) symbol)
)
)
(defmethod reset! tippy ((this tippy) (arg0 process-drawable) (arg1 float) (arg2 float))
(defmethod reset! ((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))
@@ -36,7 +33,7 @@
(none)
)
(defmethod tippy-method-10 tippy ((this tippy) (arg0 process-drawable) (arg1 vector))
(defmethod tippy-method-10 ((this tippy) (arg0 process-drawable) (arg1 vector))
(let ((s4-0 #t))
(cond
(arg1
+10 -18
View File
@@ -9,10 +9,6 @@
(deftype camera-voicebox (camera-slave)
()
:heap-base #x9a0
:method-count-assert 14
:size-assert #xa04
:flag-assert #xe09a00a04
(:states
cam-voicebox
)
@@ -20,21 +16,17 @@
(deftype voicebox (process-drawable)
((parent-override (pointer camera-voicebox) :offset 12)
(base-trans vector :inline :offset-assert 176)
(seeker cam-float-seeker :inline :offset-assert 192)
(blend float :offset-assert 216)
(twist float :offset-assert 220)
(hint handle :offset-assert 224)
((parent-override (pointer camera-voicebox) :overlay-at parent)
(base-trans vector :inline)
(seeker cam-float-seeker :inline)
(blend float)
(twist float)
(hint handle)
)
:heap-base #x80
:method-count-assert 23
:size-assert #xe8
:flag-assert #x17008000e8
(:methods
(enter () _type_ :state 20)
(idle () _type_ :state 21)
(exit () _type_ :state 22)
(:state-methods
enter
idle
exit
)
)
+10 -17
View File
@@ -8,14 +8,10 @@
;; DECOMP BEGINS
(deftype water-anim (water-vol)
((ppointer-water-anim (pointer water-anim) :offset 24)
(look int32 :offset-assert 212)
(play-ambient-sound? symbol :offset-assert 216)
((ppointer-water-anim (pointer water-anim) :overlay-at ppointer)
(look int32)
(play-ambient-sound? symbol)
)
:heap-base #x70
:method-count-assert 30
:size-assert #xdc
:flag-assert #x1e007000dc
)
@@ -260,13 +256,10 @@
)
(deftype water-anim-look (structure)
((skel-group symbol :offset-assert 0)
(anim int32 :offset-assert 4)
(ambient-sound-spec sound-spec :offset-assert 8)
((skel-group symbol)
(anim int32)
(ambient-sound-spec sound-spec)
)
:method-count-assert 9
:size-assert #xc
:flag-assert #x90000000c
)
@@ -511,15 +504,15 @@
)
)
(defmethod get-ripple-height water-anim ((this water-anim) (arg0 vector))
(defmethod get-ripple-height ((this water-anim) (arg0 vector))
(ripple-find-height this 0 arg0)
)
(defmethod set-stack-size! water-anim ((this water-anim))
(defmethod set-stack-size! ((this water-anim))
(none)
)
(defmethod water-vol-method-25 water-anim ((this water-anim))
(defmethod water-vol-method-25 ((this water-anim))
(local-vars (sv-16 res-tag))
(set! (-> this play-ambient-sound?) #t)
(set! (-> this look) (res-lump-value (-> this entity) 'look int :default (the-as uint128 -1)))
@@ -539,7 +532,7 @@
(none)
)
(defmethod water-vol-method-22 water-anim ((this water-anim))
(defmethod water-vol-method-22 ((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")
+64 -69
View File
@@ -45,59 +45,56 @@
;; DECOMP BEGINS
(deftype water-control (basic)
((flags water-flags :offset-assert 4)
(process process-drawable :offset-assert 8)
(joint-index int32 :offset-assert 12)
(top-y-offset float :offset-assert 16)
(ripple-size meters :offset-assert 20)
(enter-water-time time-frame :offset-assert 24)
(wade-time time-frame :offset-assert 32)
(on-water-time time-frame :offset-assert 40)
(enter-swim-time time-frame :offset-assert 48)
(swim-time time-frame :offset-assert 56)
(base-height meters :offset-assert 64)
(wade-height meters :offset-assert 68)
(swim-height meters :offset-assert 72)
(surface-height meters :offset-assert 76)
(bottom-height meters :offset-assert 80)
(height meters :offset-assert 84)
(height-offset float 4 :offset-assert 88)
(real-ocean-offset meters :offset 88)
(ocean-offset meters :offset 92)
(bob-offset meters :offset 96)
(align-offset meters :offset 100)
(swim-depth meters :offset-assert 104)
(bob smush-control :inline :offset-assert 112)
(volume handle :offset-assert 144)
(bottom vector 2 :inline :offset-assert 160)
(top vector 2 :inline :offset-assert 192)
(enter-water-pos vector :inline :offset-assert 224)
(drip-old-pos vector :inline :offset-assert 240)
(drip-joint-index int32 :offset-assert 256)
(drip-wetness float :offset-assert 260)
(drip-time time-frame :offset-assert 264)
(drip-speed float :offset-assert 272)
(drip-height meters :offset-assert 276)
(drip-mult float :offset-assert 280)
((flags water-flags)
(process process-drawable)
(joint-index int32)
(top-y-offset float)
(ripple-size meters)
(enter-water-time time-frame)
(wade-time time-frame)
(on-water-time time-frame)
(enter-swim-time time-frame)
(swim-time time-frame)
(base-height meters)
(wade-height meters)
(swim-height meters)
(surface-height meters)
(bottom-height meters)
(height meters)
(height-offset float 4)
(real-ocean-offset meters :overlay-at (-> height-offset 0))
(ocean-offset meters :overlay-at (-> height-offset 1))
(bob-offset meters :overlay-at (-> height-offset 2))
(align-offset meters :overlay-at (-> height-offset 3))
(swim-depth meters)
(bob smush-control :inline)
(volume handle)
(bottom vector 2 :inline)
(top vector 2 :inline)
(enter-water-pos vector :inline)
(drip-old-pos vector :inline)
(drip-joint-index int32)
(drip-wetness float)
(drip-time time-frame)
(drip-speed float)
(drip-height meters)
(drip-mult float)
)
:method-count-assert 17
:size-assert #x11c
:flag-assert #x110000011c
(:methods
(new (symbol type process int float float float) _type_ 0)
(water-control-method-9 (_type_) none 9)
(water-control-method-10 (_type_) none 10)
(start-bobbing! (_type_ float int int) none 11)
(distance-from-surface (_type_) float 12)
(create-splash (_type_ float vector int vector) none 13)
(display-water-marks? (_type_) symbol 14)
(water-control-method-15 (_type_) none 15)
(water-control-method-16 (_type_) none 16)
(new (symbol type process int float float float) _type_)
(water-control-method-9 (_type_) none)
(water-control-method-10 (_type_) none)
(start-bobbing! (_type_ float int int) none)
(distance-from-surface (_type_) float)
(create-splash (_type_ float vector int vector) none)
(display-water-marks? (_type_) symbol)
(water-control-method-15 (_type_) none)
(water-control-method-16 (_type_) none)
)
)
(defmethod display-water-marks? water-control ((this water-control))
(defmethod display-water-marks? ((this water-control))
(and *display-water-marks* (logtest? (-> this flags) (water-flags wt00)))
)
@@ -116,33 +113,31 @@
)
)
(defmethod distance-from-surface water-control ((this water-control))
(defmethod distance-from-surface ((this water-control))
(- (-> this top 0 y) (-> this height))
)
(deftype water-vol (process-drawable)
((water-height meters :offset-assert 176)
(wade-height meters :offset-assert 180)
(swim-height meters :offset-assert 184)
(bottom-height meters :offset-assert 188)
(attack-event symbol :offset-assert 192)
(target handle :offset-assert 200)
(flags water-flags :offset-assert 208)
((water-height meters)
(wade-height meters)
(swim-height meters)
(bottom-height meters)
(attack-event symbol)
(target handle)
(flags water-flags)
)
:heap-base #x70
:method-count-assert 30
:size-assert #xd4
:flag-assert #x1e007000d4
(:state-methods
water-vol-idle
water-vol-startup
)
(:methods
(water-vol-idle () _type_ :state 20)
(water-vol-startup () _type_ :state 21)
(water-vol-method-22 (_type_) none 22)
(reset-root! (_type_) none 23)
(set-stack-size! (_type_) none 24)
(water-vol-method-25 (_type_) none 25)
(update! (_type_) none 26)
(on-exit-water (_type_) none 27)
(get-ripple-height (_type_ vector) float 28)
(init! (_type_) none 29)
(water-vol-method-22 (_type_) none)
(reset-root! (_type_) none)
(set-stack-size! (_type_) none)
(water-vol-method-25 (_type_) none)
(update! (_type_) none)
(on-exit-water (_type_) none)
(get-ripple-height (_type_ vector) float)
(init! (_type_) none)
)
)
+14 -14
View File
@@ -616,12 +616,12 @@
)
)
(defmethod water-control-method-9 water-control ((this water-control))
(defmethod water-control-method-9 ((this water-control))
0
(none)
)
(defmethod water-control-method-10 water-control ((this water-control))
(defmethod water-control-method-10 ((this water-control))
(with-pp
(let ((s5-0 (-> this flags)))
(cond
@@ -967,7 +967,7 @@
)
)
(defmethod start-bobbing! water-control ((this water-control) (arg0 float) (arg1 int) (arg2 int))
(defmethod start-bobbing! ((this water-control) (arg0 float) (arg1 int) (arg2 int))
(activate! (-> this bob) (- arg0) arg1 arg2 0.9 1.0)
0
(none)
@@ -1064,7 +1064,7 @@
(none)
)
(defmethod water-control-method-15 water-control ((this water-control))
(defmethod water-control-method-15 ((this water-control))
(with-pp
(logior! (-> this flags) (water-flags wt09))
(logclear! (-> this flags) (water-flags wt16))
@@ -1094,7 +1094,7 @@
)
)
(defmethod water-control-method-16 water-control ((this water-control))
(defmethod water-control-method-16 ((this water-control))
(logclear! (-> this flags) (water-flags wt09))
(set-zero! (-> this bob))
(if (logtest? (water-flags wt17) (-> this flags))
@@ -1123,7 +1123,7 @@
(none)
)
(defmethod create-splash water-control ((this water-control) (arg0 float) (arg1 vector) (arg2 int) (arg3 vector))
(defmethod create-splash ((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) (-> this surface-height))
@@ -1134,7 +1134,7 @@
(none)
)
(defmethod on-exit-water water-vol ((this water-vol))
(defmethod on-exit-water ((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))
@@ -1157,7 +1157,7 @@
(none)
)
(defmethod update! water-vol ((this water-vol))
(defmethod update! ((this water-vol))
(cond
((handle->process (-> this target))
(cond
@@ -1248,22 +1248,22 @@
:code anim-loop
)
(defmethod set-stack-size! water-vol ((this water-vol))
(defmethod set-stack-size! ((this water-vol))
(stack-size-set! (-> this main-thread) 128)
(none)
)
(defmethod reset-root! water-vol ((this water-vol))
(defmethod reset-root! ((this water-vol))
(set! (-> this root) (new 'process 'trsqv))
(none)
)
(defmethod water-vol-method-25 water-vol ((this water-vol))
(defmethod water-vol-method-25 ((this water-vol))
0
(none)
)
(defmethod init! water-vol ((this water-vol))
(defmethod init! ((this water-vol))
(local-vars (sv-16 res-tag))
(set! (-> this attack-event) (the-as symbol ((method-of-type res-lump get-property-struct)
(-> this entity)
@@ -1323,7 +1323,7 @@
(none)
)
(defmethod water-vol-method-22 water-vol ((this water-vol))
(defmethod water-vol-method-22 ((this water-vol))
0
(none)
)
@@ -1339,7 +1339,7 @@
(none)
)
(defmethod init-from-entity! water-vol ((this water-vol) (arg0 entity-actor))
(defmethod init-from-entity! ((this water-vol) (arg0 entity-actor))
(set-stack-size! this)
(reset-root! this)
(init! this)
+125 -195
View File
@@ -14,129 +14,98 @@
;; base type for all joint animations
;; note that this refers to an animation for a single joint.
(deftype joint-anim (basic)
((name string :offset-assert 4)
(number int16 :offset-assert 8)
(length int16 :offset-assert 10)
((name string)
(number int16)
(length int16)
)
:method-count-assert 9
:size-assert #xc
:flag-assert #x90000000c
)
;; unused? joint-anims
(deftype joint-anim-matrix (joint-anim)
((data matrix :inline :dynamic :offset 16)
((data matrix :inline :dynamic :offset 16)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
(deftype joint-anim-transformq (joint-anim)
((data transformq :inline :dynamic :offset 16)
((data transformq :inline :dynamic :offset 16)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
(deftype joint-anim-drawable (joint-anim)
((data drawable :dynamic :offset-assert 12) ;; guess
((data drawable :dynamic)
)
:method-count-assert 9
:size-assert #xc
:flag-assert #x90000000c
)
;; joint-anim-compressed is the only type of joint-anim actually used.
;; the actual data isn't in here, this is just some metadata
;; again, this refers to a single joint
(deftype joint-anim-compressed (joint-anim)
((data uint32 :dynamic :offset-assert 12) ;; seems to always just be 1 zero.
((data uint32 :dynamic)
)
:method-count-assert 9
:size-assert #xc
:flag-assert #x90000000c
)
;; a single "frame" in an animation, consists of matrices for each joint.
;; unlike the previous types, this is for all of the joints involved in an animation.
(deftype joint-anim-frame (structure)
((matrices matrix 2 :inline :offset-assert 0) ;; everybody has at least 2 matrices
(data matrix :inline :dynamic :offset-assert 128) ;; rest are dynamically sized.
((matrices matrix 2 :inline)
(data matrix :inline :dynamic)
)
:method-count-assert 9
:size-assert #x80
:flag-assert #x900000080
(:methods
(new (symbol type int) _type_ 0)
(new (symbol type int) _type_)
)
)
(defmethod new joint-anim-frame ((allocation symbol) (type-to-make type) (arg0 int))
"Create a new joint-anim-frame with enough room for arg0 matrices"
(let ((v1-1 (max 0 (+ arg0 -2))))
(the-as joint-anim-frame
(new-dynamic-structure
allocation
type-to-make
(the-as int (+ (-> type-to-make size) (the-as uint (* 48 v1-1)))))
)
(the-as
joint-anim-frame
(new-dynamic-structure allocation type-to-make (the-as int (+ (-> type-to-make size) (* 48 v1-1))))
)
)
)
;; compression header - has info used by decompression algorithm
(deftype joint-anim-compressed-hdr (structure)
((control-bits uint32 14 :offset-assert 0)
(num-joints uint32 :offset-assert 56)
(matrix-bits uint32 :offset-assert 60)
((control-bits uint32 14)
(num-joints uint32)
(matrix-bits uint32)
)
:method-count-assert 9
:size-assert #x40
:flag-assert #x900000040
)
;; this has the data needed to initialize the decompressor - I believe this
;; contains the starting poisition of the joints.
(deftype joint-anim-compressed-fixed (structure)
((hdr joint-anim-compressed-hdr :inline :offset-assert 0)
(offset-64 uint32 :offset-assert 64)
(offset-32 uint32 :offset-assert 68)
(offset-16 uint32 :offset-assert 72)
(reserved uint32 :offset-assert 76)
(data vector 133 :inline :offset-assert 80) ;; length here can be shorter!
((hdr joint-anim-compressed-hdr :inline)
(offset-64 uint32)
(offset-32 uint32)
(offset-16 uint32)
(reserved uint32)
(data vector 133 :inline)
)
:method-count-assert 9
:size-assert #x8a0
:flag-assert #x9000008a0
)
;; these are the actual compressed data frames.
;; dynamically sized, depends on the number of joints and the decompression.
(deftype joint-anim-compressed-frame (structure)
((offset-64 uint32 :offset-assert 0)
(offset-32 uint32 :offset-assert 4)
(offset-16 uint32 :offset-assert 8)
(reserved uint32 :offset-assert 12)
(data vector 133 :inline :offset-assert 16) ;; guess
((offset-64 uint32)
(offset-32 uint32)
(offset-16 uint32)
(reserved uint32)
(data vector 133 :inline)
)
:method-count-assert 9
:size-assert #x860
:flag-assert #x900000860
)
;; table of frames
(deftype joint-anim-compressed-control (structure)
((num-frames uint32 :offset-assert 0)
(fixed-qwc uint32 :offset-assert 4)
(frame-qwc uint32 :offset-assert 8)
(fixed joint-anim-compressed-fixed :offset-assert 12)
(data joint-anim-compressed-frame 1 :offset-assert 16) ;; guess
((num-frames uint32)
(fixed-qwc uint32)
(frame-qwc uint32)
(fixed joint-anim-compressed-fixed)
(data joint-anim-compressed-frame 1)
)
:method-count-assert 9
:size-assert #x14
:flag-assert #x900000014
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -147,118 +116,88 @@
;; it can be either a container of arts (art-group) or a single art (art-element)
(declare-type res-lump basic)
(deftype art (basic)
((name string :offset 8)
(length int32 :offset-assert 12)
(extra res-lump :offset-assert 16)
((name string :offset 8)
(length int32)
(extra res-lump)
)
:method-count-assert 13
:size-assert #x14
:flag-assert #xd00000014
(:methods
(login (_type_) _type_ 9)
(lookup-art (_type_ string type) joint 10) ;; art or joint.
(lookup-idx-of-art (_type_ string type) int 11)
(needs-link? (_type_) symbol 12)
(login (_type_) _type_)
(lookup-art (_type_ string type) joint)
(lookup-idx-of-art (_type_ string type) int)
(needs-link? (_type_) symbol)
)
)
;; parent class of all single art things.
(deftype art-element (art)
((pad uint8 12))
:method-count-assert 13
:size-assert #x20
:flag-assert #xd00000020
((pad uint8 12)
)
)
;; unused. all animations use joints/skeletons.
(deftype art-mesh-anim (art-element)
((data basic :dynamic :offset-assert 32))
:method-count-assert 13
:size-assert #x20
:flag-assert #xd00000020
((data basic :dynamic)
)
)
;; joint animation.
(declare-type merc-eye-anim-block structure)
(deftype art-joint-anim (art-element)
;; figured out manually from custom inspect.
((eye-anim-data merc-eye-anim-block :offset 4) ;; guessed on the name here, it's not in the inspect.
(speed float :offset 20)
(artist-base float :offset 24)
(artist-step float :offset 28)
(master-art-group-name string :offset 32)
(master-art-group-index int32 :offset 36)
;; facial animation
(blerc-data (pointer uint8) :offset 40) ;; todo, this is probably something else
;; compressed animation data
(frames joint-anim-compressed-control :offset 44)
;; per-joint info for each joint in the animation.
(data joint-anim-compressed :dynamic)
((eye-anim-data merc-eye-anim-block :offset 4)
(speed float :overlay-at (-> pad 0))
(artist-base float :overlay-at (-> pad 4))
(artist-step float :overlay-at (-> pad 8))
(master-art-group-name string :offset 32)
(master-art-group-index int32 :offset 36)
(blerc-data (pointer uint8) :offset 40)
(frames joint-anim-compressed-control :offset 44)
(data joint-anim-compressed :dynamic)
)
:method-count-assert 13
:size-assert #x30
:flag-assert #xd00000030
)
;; a collection of arts.
;; this is often stored as a -ag file in static level data.
(deftype art-group (art)
((info file-info :offset 4)
(data art-element :dynamic :offset 32)
((info file-info :offset 4)
(data art-element :dynamic :offset 32)
)
:method-count-assert 15
:size-assert #x20
:flag-assert #xf00000020
(:methods
;; linker will call this one when it's loaded
(relocate (_type_ kheap (pointer uint8)) none :replace 7)
(link-art! (_type_) art-group 13)
(unlink-art! (_type_) int 14)
(relocate (_type_ kheap (pointer uint8)) none :replace)
(link-art! (_type_) art-group)
(unlink-art! (_type_) int)
)
)
;; unused
(deftype art-mesh-geo (art-element)
((data basic :dynamic :offset-assert 32)
((data basic :dynamic)
)
:method-count-assert 13
:size-assert #x20
:flag-assert #xd00000020
)
;; unused
(deftype art-joint-geo (art-element)
((data joint :dynamic :offset-assert 32)
((data joint :dynamic)
)
:method-count-assert 13
:size-assert #x20
:flag-assert #xd00000020
)
;; the "skeleton group" is defined in code and tells the engine
;; how to actually use the art from the level data for this object.
(deftype skeleton-group (basic)
((art-group-name string :offset-assert 4)
(jgeo int32 :offset-assert 8)
(janim int32 :offset-assert 12)
(bounds vector :inline :offset-assert 16)
(radius meters :offset 28)
(mgeo int16 4 :offset-assert 32)
(max-lod int32 :offset-assert 40)
(lod-dist float 4 :offset-assert 44)
(longest-edge meters :offset-assert 60)
(texture-level int8 :offset-assert 64)
(version int8 :offset-assert 65)
(shadow int8 :offset-assert 66)
(sort int8 :offset-assert 67)
(_pad uint8 4 :offset-assert 68)
((art-group-name string)
(jgeo int32)
(janim int32)
(bounds vector :inline)
(radius meters :overlay-at (-> bounds w))
(mgeo int16 4)
(max-lod int32)
(lod-dist float 4)
(longest-edge meters)
(texture-level int8)
(version int8)
(shadow int8)
(sort int8)
(_pad uint8 4)
)
:method-count-assert 9
:size-assert #x48
:flag-assert #x900000048
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -271,27 +210,21 @@
;; a merc level of detail
(deftype lod-group (structure)
((geo merc-ctrl :offset-assert 0) ;; the actual geometry to draw
(dist meters :offset-assert 4) ;; the distance from camera for this lod
((geo merc-ctrl)
(dist meters)
)
:pack-me
:method-count-assert 9
:size-assert #x8
:flag-assert #x900000008
)
;; the 4 levels of detail. the max-lod is the index of the highest lod that's actually used.
;; it is the lowest detail.
(deftype lod-set (structure)
((lod lod-group 4 :inline :offset-assert 0)
(max-lod int8 :offset-assert 32)
((lod lod-group 4 :inline)
(max-lod int8)
)
:pack-me
:method-count-assert 10
:size-assert #x21
:flag-assert #xa00000021
(:methods
(setup-lods! (_type_ skeleton-group art-group entity) _type_ 9)
(setup-lods! (_type_ skeleton-group art-group entity) _type_)
)
)
@@ -330,59 +263,56 @@
;; the actual draw-control - this is just a collection of references to all info
;; needed to do drawing.
(deftype draw-control (basic)
((status draw-status :offset-assert 4)
(matrix-type uint8 :offset-assert 5)
(data-format uint8 :offset-assert 6)
(global-effect draw-effect :offset-assert 7)
(art-group art-group :offset-assert 8)
(jgeo art-joint-geo :offset-assert 12)
(mgeo merc-ctrl :offset-assert 16)
(dma-add-func (function process-drawable draw-control symbol object none) :offset-assert 20)
(skeleton skeleton :offset-assert 24) ;; or cspace-array or shadow-control
(lod-set lod-set :inline :offset-assert 28)
(lod lod-group 4 :inline :offset 28)
(max-lod int8 :offset 60)
(force-lod int8 :offset-assert 61)
(cur-lod int8 :offset-assert 62)
(desired-lod int8 :offset-assert 63)
(ripple ripple-control :offset-assert 64)
(longest-edge meters :offset-assert 68)
(longest-edge? uint32 :offset 68)
(light-index uint8 :offset-assert 72)
(dummy uint8 2 :offset-assert 73)
(death-draw-overlap uint8 :offset-assert 75)
(death-timer uint8 :offset-assert 76)
(death-timer-org uint8 :offset-assert 77)
(death-vertex-skip uint16 :offset-assert 78)
(death-effect uint32 :offset-assert 80)
(sink-group dma-foreground-sink-group :offset-assert 84) ;; dma-foreground-sink-group?
(process process :offset-assert 88)
(shadow shadow-geo :offset-assert 92)
(shadow-ctrl shadow-control :offset-assert 96)
(origin vector :inline :offset-assert 112)
(bounds vector :inline :offset-assert 128)
(radius meters :offset 140)
(color-mult rgbaf :inline :offset-assert 144)
(color-emissive rgbaf :inline :offset-assert 160)
(secondary-interp float :offset-assert 176)
(current-secondary-interp float :offset-assert 180)
(shadow-mask uint8 :offset-assert 184)
(level-index uint8 :offset-assert 185)
(origin-joint-index uint8 :offset-assert 186)
(shadow-joint-index uint8 :offset-assert 187)
((status draw-status)
(matrix-type uint8)
(data-format uint8)
(global-effect draw-effect)
(art-group art-group)
(jgeo art-joint-geo)
(mgeo merc-ctrl)
(dma-add-func (function process-drawable draw-control symbol object none))
(skeleton skeleton)
(lod-set lod-set :inline)
(lod lod-group 4 :inline :overlay-at (-> lod-set lod 0))
(max-lod int8 :overlay-at (-> lod-set max-lod))
(force-lod int8)
(cur-lod int8)
(desired-lod int8)
(ripple ripple-control)
(longest-edge meters)
(longest-edge? uint32 :overlay-at longest-edge)
(light-index uint8)
(dummy uint8 2)
(death-draw-overlap uint8)
(death-timer uint8)
(death-timer-org uint8)
(death-vertex-skip uint16)
(death-effect uint32)
(sink-group dma-foreground-sink-group)
(process process)
(shadow shadow-geo)
(shadow-ctrl shadow-control)
(origin vector :inline)
(bounds vector :inline)
(radius meters :overlay-at (-> bounds w))
(color-mult rgbaf :inline)
(color-emissive rgbaf :inline)
(secondary-interp float)
(current-secondary-interp float)
(shadow-mask uint8)
(level-index uint8)
(origin-joint-index uint8)
(shadow-joint-index uint8)
)
:method-count-assert 12
:size-assert #xbc
:flag-assert #xc000000bc
(:methods
(new (symbol type process art-joint-geo) _type_ 0)
(get-skeleton-origin (_type_) vector 9)
(lod-set! (_type_ int) none 10)
(lods-assign! (_type_ lod-set) none 11)
(new (symbol type process art-joint-geo) _type_)
(get-skeleton-origin (_type_) vector)
(lod-set! (_type_ int) none)
(lods-assign! (_type_ lod-set) none)
)
)
(defmethod get-skeleton-origin draw-control ((this draw-control))
(defmethod get-skeleton-origin ((this draw-control))
"Get the origin of the skeleton. Must have up-to-date bones."
(-> this skeleton bones 0 position)
)
+92 -117
View File
@@ -33,61 +33,52 @@
(declare-file (debug))
(deftype list-control (structure)
((listfunc (function int list-control symbol) :offset-assert 0)
(list-owner uint32 :offset-assert 4)
(top int32 :offset-assert 8)
(left int32 :offset-assert 12)
(list glst-list :offset-assert 16)
(the-node glst-node :offset-assert 20)
(top-index int32 :offset-assert 24)
(the-index int32 :offset-assert 28)
(the-disp-line int32 :offset-assert 32)
(highlight-index int32 :offset-assert 36)
(current-index int32 :offset-assert 40)
(numlines int32 :offset-assert 44)
(lines-to-disp int32 :offset-assert 48)
(charswide int32 :offset-assert 52)
(highlight-disp-line int32 :offset-assert 56)
(field-id int32 :offset-assert 60)
(xpos int32 :offset-assert 64)
(ypos int32 :offset-assert 68)
(user-info int32 :offset-assert 72)
(user-info-u uint32 :offset 72)
(return-int int32 :offset-assert 76)
((listfunc (function int list-control symbol))
(list-owner uint32)
(top int32)
(left int32)
(list glst-list)
(the-node glst-node)
(top-index int32)
(the-index int32)
(the-disp-line int32)
(highlight-index int32)
(current-index int32)
(numlines int32)
(lines-to-disp int32)
(charswide int32)
(highlight-disp-line int32)
(field-id int32)
(xpos int32)
(ypos int32)
(user-info int32)
(user-info-u uint32 :overlay-at user-info)
(return-int int32)
)
:allow-misaligned
:method-count-assert 9
:size-assert #x50
:flag-assert #x900000050
)
(deftype list-field (structure)
((left int32 :offset-assert 0)
(width int32 :offset-assert 4)
((left int32)
(width int32)
)
:method-count-assert 9
:size-assert #x8
:flag-assert #x900000008
)
(deftype DISP_LIST-bank (basic)
((TV_SPACING int32 :offset-assert 4)
(BORDER_WIDTH int32 :offset-assert 8)
(BORDER_HEIGHT int32 :offset-assert 12)
(MAX_LINES int32 :offset-assert 16)
(CHAR_WIDTH int32 :offset-assert 20)
(INC_DELAY int32 :offset-assert 24)
(BORDER_LINES int32 :offset-assert 28)
(CXOFF int32 :offset-assert 32)
(CYOFF int32 :offset-assert 36)
(BXOFF int32 :offset-assert 40)
(BYOFF int32 :offset-assert 44)
((TV_SPACING int32)
(BORDER_WIDTH int32)
(BORDER_HEIGHT int32)
(MAX_LINES int32)
(CHAR_WIDTH int32)
(INC_DELAY int32)
(BORDER_LINES int32)
(CXOFF int32)
(CYOFF int32)
(BXOFF int32)
(BYOFF int32)
)
:method-count-assert 9
:size-assert #x30
:flag-assert #x900000030
)
@@ -357,26 +348,23 @@
)
(deftype anim-tester-bank (basic)
((ANIM_SPEED float :offset-assert 4)
(BLEND float :offset-assert 8)
(OBJECT_LIST_X int32 :offset-assert 12)
(OBJECT_LIST_Y int32 :offset-assert 16)
(OBJECT_LIST_MIN_WIDTH int32 :offset-assert 20)
(ANIM_LIST_X int32 :offset-assert 24)
(ANIM_LIST_Y int32 :offset-assert 28)
(ANIM_LIST_MIN_WIDTH int32 :offset-assert 32)
(PICK_LIST_X int32 :offset-assert 36)
(PICK_LIST_Y int32 :offset-assert 40)
(PICK_LIST_MIN_WIDTH int32 :offset-assert 44)
(EDIT_LIST_X int32 :offset-assert 48)
(EDIT_LIST_Y int32 :offset-assert 52)
(EDIT_STATS_X int32 :offset-assert 56)
(EDIT_LIST_MIN_WIDTH int32 :offset-assert 60)
(EDIT_PICK_X int32 :offset-assert 64)
((ANIM_SPEED float)
(BLEND float)
(OBJECT_LIST_X int32)
(OBJECT_LIST_Y int32)
(OBJECT_LIST_MIN_WIDTH int32)
(ANIM_LIST_X int32)
(ANIM_LIST_Y int32)
(ANIM_LIST_MIN_WIDTH int32)
(PICK_LIST_X int32)
(PICK_LIST_Y int32)
(PICK_LIST_MIN_WIDTH int32)
(EDIT_LIST_X int32)
(EDIT_LIST_Y int32)
(EDIT_STATS_X int32)
(EDIT_LIST_MIN_WIDTH int32)
(EDIT_PICK_X int32)
)
:method-count-assert 9
:size-assert #x44
:flag-assert #x900000044
)
@@ -401,26 +389,22 @@
)
(deftype anim-tester (process-drawable)
((flags anim-tester-flags :offset-assert 176)
(obj-list glst-list :inline :offset-assert 180)
(current-obj string :offset-assert 196)
(speed int32 :offset-assert 200)
(list-con list-control :inline :offset-assert 204)
(pick-con list-control :inline :offset-assert 284)
(item-field int64 :offset-assert 368)
(inc-delay int32 :offset-assert 376)
(inc-timer int32 :offset-assert 380)
(edit-mode int32 :offset-assert 384)
(old-mode int32 :offset-assert 388)
(anim-speed float :offset-assert 392)
(anim-gspeed float :offset-assert 396)
(anim-first float :offset-assert 400)
(anim-last float :offset-assert 404)
((flags anim-tester-flags)
(obj-list glst-list :inline)
(current-obj string)
(speed int32)
(list-con list-control :inline)
(pick-con list-control :inline)
(item-field int64)
(inc-delay int32)
(inc-timer int32)
(edit-mode int32)
(old-mode int32)
(anim-speed float)
(anim-gspeed float)
(anim-first float)
(anim-last float)
)
:heap-base #x130
:method-count-assert 20
:size-assert #x198
:flag-assert #x1401300198
(:states
anim-tester-process
)
@@ -445,23 +429,20 @@
(define-perm *anim-tester* (pointer anim-tester) #f)
(deftype anim-test-obj (glst-named-node)
((obj-art-group art-group :offset-assert 12)
(seq-list glst-list :inline :offset-assert 16)
(flags int32 :offset-assert 32)
(mesh-geo merc-ctrl :offset-assert 36)
(joint-geo art-joint-geo :offset-assert 40)
(list-con list-control :inline :offset-assert 44)
(parent uint32 :offset-assert 124)
(anim-index int32 :offset-assert 128)
(anim-hindex int32 :offset-assert 132)
(seq-index int32 :offset-assert 136)
(seq-hindex int32 :offset-assert 140)
((obj-art-group art-group)
(seq-list glst-list :inline)
(flags int32)
(mesh-geo merc-ctrl)
(joint-geo art-joint-geo)
(list-con list-control :inline)
(parent uint32)
(anim-index int32)
(anim-hindex int32)
(seq-index int32)
(seq-hindex int32)
)
:method-count-assert 9
:size-assert #x90
:flag-assert #x900000090
(:methods
(new (symbol type int string basic) _type_ 0)
(new (symbol type int string basic) _type_)
)
)
@@ -499,17 +480,14 @@
)
(deftype anim-test-sequence (glst-named-node)
((item-list glst-list :inline :offset-assert 12)
(playing-item int32 :offset-assert 28)
(flags int32 :offset-assert 32)
(list-con list-control :inline :offset-assert 36)
(parent anim-test-obj :offset-assert 116)
((item-list glst-list :inline)
(playing-item int32)
(flags int32)
(list-con list-control :inline)
(parent anim-test-obj)
)
:method-count-assert 9
:size-assert #x78
:flag-assert #x900000078
(:methods
(new (symbol type int string) _type_ 0)
(new (symbol type int string) _type_)
)
)
@@ -538,20 +516,17 @@
)
(deftype anim-test-seq-item (glst-named-node)
((speed int32 :offset-assert 12)
(blend int32 :offset-assert 16)
(first-frame float :offset-assert 20)
(last-frame float :offset-assert 24)
(num-frames float :offset-assert 28)
(artist-base float :offset-assert 32)
(flags int32 :offset-assert 36)
(parent anim-test-sequence :offset-assert 40)
((speed int32)
(blend int32)
(first-frame float)
(last-frame float)
(num-frames float)
(artist-base float)
(flags int32)
(parent anim-test-sequence)
)
:method-count-assert 9
:size-assert #x2c
:flag-assert #x90000002c
(:methods
(new (symbol type int string) _type_ 0)
(new (symbol type int string) _type_)
)
)
+8 -11
View File
@@ -8,30 +8,27 @@
;; DECOMP BEGINS
(deftype __assert-info-private-struct (structure)
((filename string :offset-assert 0)
(line-num uint16 :offset-assert 4)
(column-num uint16 :offset-assert 6)
((filename string)
(line-num uint16)
(column-num uint16)
)
:method-count-assert 11
:size-assert #x8
:flag-assert #xb00000008
(:methods
(set-pos (_type_ string uint uint) int 9)
(print-pos (_type_) int 10)
(set-pos (_type_ string uint uint) int)
(print-pos (_type_) int)
)
)
(defmethod set-pos __assert-info-private-struct ((this __assert-info-private-struct) (filename string) (line-num uint) (column-num uint))
(defmethod set-pos ((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 ((this __assert-info-private-struct))
(defmethod print-pos ((this __assert-info-private-struct))
(format #t "file ~S.gc, line ~D, col ~D.~%" (-> this filename) (-> this line-num) (-> this column-num))
0
)
(define *__private-assert-info* (new 'static '__assert-info-private-struct))
+11 -21
View File
@@ -19,36 +19,26 @@
;; circular buffer of positions to draw.
(deftype pos-history (structure)
((points (inline-array vector) :offset-assert 0)
(num-points int32 :offset-assert 4)
(h-first int32 :offset-assert 8)
(h-last int32 :offset-assert 12)
((points (inline-array vector))
(num-points int32)
(h-first int32)
(h-last int32)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; unused vertex type?
(deftype debug-vertex (structure)
((trans vector4w :inline :offset-assert 0)
(normal vector3h :inline :offset-assert 16)
(st vector2h :inline :offset-assert 22)
(color uint32 :offset-assert 28)
((trans vector4w :inline)
(normal vector3h :inline)
(st vector2h :inline)
(color uint32)
)
:method-count-assert 9
:size-assert #x20
:flag-assert #x900000020
)
;; buffer of debug vertices (unused?)
(deftype debug-vertex-stats (basic)
((length int32 :offset-assert 4)
(pos-count int32 :offset-assert 8)
(vertex debug-vertex 600 :inline :offset-assert 16)
((length int32)
(pos-count int32)
(vertex debug-vertex 600 :inline)
)
:method-count-assert 9
:size-assert #x4b10
:flag-assert #x900004b10
)
+5 -6
View File
@@ -12,13 +12,11 @@
;; DECOMP BEGINS
(deftype debug-sphere-table (basic)
((point vector 300 :inline :offset-assert 16)
((point vector 300 :inline)
)
:method-count-assert 9
:size-assert #x12d0
:flag-assert #x9000012d0
)
(defun make-debug-sphere-table ((arg0 debug-sphere-table))
(local-vars (sv-80 int))
(let ((s5-0 (new-stack-vector0))
@@ -88,10 +86,11 @@
(.svf (&-> s4-0 quad) vf3)
(.svf (&-> s3-0 quad) vf4)
(.svf (&-> s2-0 quad) vf5)
(add-debug-line #t arg0 s4-0 s3-0 arg3 #f (the rgba -1))
(add-debug-line #t arg0 s4-0 s2-0 arg3 #f (the rgba -1))
(add-debug-line #t arg0 s4-0 s3-0 arg3 #f (the-as rgba -1))
(add-debug-line #t arg0 s4-0 s2-0 arg3 #f (the-as rgba -1))
)
)
0
(none)
)
)
+17 -25
View File
@@ -307,41 +307,33 @@
(when *debug-segment*
(deftype debug-line (structure)
((flags int32 :offset-assert 0)
(bucket bucket-id :offset-assert 4)
(v1 vector :inline :offset-assert 16)
(v2 vector :inline :offset-assert 32)
(color rgba :offset-assert 48)
(mode symbol :offset-assert 52)
(color2 rgba :offset-assert 56)
((flags int32)
(bucket bucket-id)
(v1 vector :inline)
(v2 vector :inline)
(color rgba)
(mode symbol)
(color2 rgba)
)
:method-count-assert 9
:size-assert #x3c
:flag-assert #x90000003c
)
(deftype debug-text-3d (structure)
((flags int32 :offset-assert 0)
(bucket bucket-id :offset-assert 4)
(pos vector :inline :offset-assert 16)
(color font-color :offset-assert 32)
(offset vector2h :inline :offset-assert 40)
(str string :offset-assert 44)
((flags int32)
(bucket bucket-id)
(pos vector :inline)
(color font-color)
(offset vector2h :inline)
(str string)
)
:method-count-assert 9
:size-assert #x30
:flag-assert #x900000030
)
(deftype debug-tracking-thang (basic)
((length int32 :offset-assert 4)
(allocated-length int32 :offset-assert 8)
((length int32)
(allocated-length int32)
)
:method-count-assert 9
:size-assert #xc
:flag-assert #x90000000c
)
;; allocate debug draw buffers
+10 -16
View File
@@ -20,29 +20,23 @@
;; Information for a single category.
(deftype memory-usage-info (structure)
((name string :offset-assert 0)
(count int32 :offset-assert 4) ;; meaning depends on category. For textures, it's the number of textures, for example.
(used int32 :offset-assert 8) ;; how much memory is in use (not counting padding)
(total int32 :offset-assert 12) ;; actual total memory used, including padding to 16-bytes, etc.
((name string)
(count int32)
(used int32)
(total int32)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; Memory info for all categories
(deftype memory-usage-block (basic)
((work-bsp basic :offset-assert 4)
(length int32 :offset-assert 8)
(data memory-usage-info 109 :inline :offset-assert 16)
((work-bsp basic)
(length int32)
(data memory-usage-info 109 :inline)
)
:method-count-assert 12
:size-assert #x6e0
:flag-assert #xc000006e0
(:methods
(reset! (_type_) _type_ 9)
(calculate-total (_type_) int 10)
(print-mem-usage (_type_ level object) none 11)
(reset! (_type_) _type_)
(calculate-total (_type_) int)
(print-mem-usage (_type_ level object) none)
)
)
+8 -9
View File
@@ -11,7 +11,7 @@
(declare-file (debug))
(defmethod inspect memory-usage-block ((this memory-usage-block))
(defmethod inspect ((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~%")
@@ -38,7 +38,7 @@
this
)
(defmethod mem-usage object ((this object) (arg0 memory-usage-block) (arg1 int))
(defmethod mem-usage ((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 this
(format #t "WARNING: mem-usage called on object, probably not what was wanted for ~A~%" this)
@@ -46,7 +46,7 @@
this
)
(defmethod calculate-total memory-usage-block ((this memory-usage-block))
(defmethod calculate-total ((this memory-usage-block))
"Compute the total memory usage of everything in the block."
(let ((v0-0 0))
(dotimes (v1-0 (-> this length))
@@ -56,7 +56,7 @@
)
)
(defmethod reset! memory-usage-block ((this memory-usage-block))
(defmethod reset! ((this memory-usage-block))
"Reset all memory stats to 0."
(set! (-> this length) 0)
(dotimes (v1-0 109)
@@ -78,8 +78,8 @@
)
)
(defmethod compute-memory-usage level ((this level) (arg0 object))
"Compute the memory usage of a level. Arg0 will force a recalculation."
(defmethod compute-memory-usage ((this level) (arg0 object))
"Compute the memory usage of a level. arg0 will force a recalculation."
(if (zero? (-> this mem-usage-block))
(set! (-> this mem-usage-block) (new 'debug 'memory-usage-block))
)
@@ -91,7 +91,7 @@
(-> this mem-usage-block)
)
(defmethod mem-usage process-tree ((this process-tree) (arg0 memory-usage-block) (arg1 int))
(defmethod mem-usage ((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*)
@@ -306,8 +306,7 @@
;; the max dma ever (excluding debug)
(define *max-dma* 0)
(defmethod print-mem-usage memory-usage-block ((this memory-usage-block) (arg0 level) (arg1 object))
(defmethod print-mem-usage ((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)
File diff suppressed because it is too large Load Diff
+4 -7
View File
@@ -17,20 +17,17 @@
(defpartgroup group-part-tester :id 105 :bounds (static-bspherem 0 0 0 1) :parts ((sp-item 56) (sp-item 57)))
(deftype part-tester (process)
((root trsqv :offset-assert 112)
(part sparticle-launch-control :offset-assert 116)
(old-group sparticle-launch-group :offset-assert 120)
((root trsqv)
(part sparticle-launch-control)
(old-group sparticle-launch-group)
)
:heap-base #x100
:method-count-assert 14
:size-assert #x7c
:flag-assert #xe0100007c
)
(define-extern *part-tester* part-tester)
(define *part-tester-name* (the-as string #f))
(defmethod deactivate part-tester ((this part-tester))
(defmethod deactivate ((this part-tester))
(if (nonzero? (-> this part))
(kill-and-free-particles (-> this part))
)
+39 -48
View File
@@ -8,71 +8,59 @@
;; DECOMP BEGINS
(deftype tr-stat (structure)
((groups uint16 :offset-assert 0)
(fragments uint16 :offset-assert 2)
(tris uint32 :offset-assert 4)
(dverts uint32 :offset-assert 8)
(instances uint16 :offset-assert 12)
(pad uint16 :offset-assert 14)
((groups uint16)
(fragments uint16)
(tris uint32)
(dverts uint32)
(instances uint16)
(pad uint16)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
(deftype merc-global-stats (structure)
((merc tr-stat :inline :offset-assert 0)
(mercneric tr-stat :inline :offset-assert 16)
((merc tr-stat :inline)
(mercneric tr-stat :inline)
)
:method-count-assert 9
:size-assert #x20
:flag-assert #x900000020
)
(deftype perf-stat (structure)
((frame-number uint32 :offset-assert 0)
(count uint32 :offset-assert 4)
(cycles uint32 :offset-assert 8)
(instructions uint32 :offset-assert 12)
(icache uint32 :offset-assert 16)
(dcache uint32 :offset-assert 20)
(select uint32 :offset-assert 24)
(ctrl uint32 :offset-assert 28)
(accum0 uint32 :offset-assert 32)
(accum1 uint32 :offset-assert 36)
(to-vu0-waits uint32 :offset-assert 40)
(to-spr-waits uint32 :offset-assert 44)
(from-spr-waits uint32 :offset-assert 48)
((frame-number uint32)
(count uint32)
(cycles uint32)
(instructions uint32)
(icache uint32)
(dcache uint32)
(select uint32)
(ctrl uint32)
(accum0 uint32)
(accum1 uint32)
(to-vu0-waits uint32)
(to-spr-waits uint32)
(from-spr-waits uint32)
)
:pack-me
:method-count-assert 14
:size-assert #x34
:flag-assert #xe00000034
(:methods
(perf-stat-method-9 (_type_) none 9)
(print-to-stream (_type_ string basic) none 10)
(reset! (_type_) none 11)
(read! (_type_) none 12)
(update-wait-stats (_type_ uint uint uint) none 13)
(perf-stat-method-9 (_type_) none)
(print-to-stream (_type_ string basic) none)
(reset! (_type_) none)
(read! (_type_) none)
(update-wait-stats (_type_ uint uint uint) none)
)
)
(deftype perf-stat-array (inline-array-class)
((data perf-stat :inline :dynamic :offset-assert 16)
((data perf-stat :inline :dynamic)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
(set! (-> perf-stat-array heap-base) (the-as uint 52))
(define *pc-perf-stat-counter* (the-as uint 0))
(defmethod reset! perf-stat ((this perf-stat))
(defmethod reset! ((this perf-stat))
"Perfomance counters are partially implemented, they just count cycles."
(+! (-> this count) 1)
(when (nonzero? (-> this ctrl))
@@ -81,12 +69,12 @@
#|
(let ((v1-0 (-> this ctrl)))
(+! (-> this count) 1)
(b! (zero? v1-0) cfg-2)
(.mtc0 Perf r0-0)
(b! (zero? v1-0) cfg-2 :delay (nop!))
(.mtc0 Perf 0)
(.sync.l)
(.sync.p)
(.mtpc pcr0 r0-0)
(.mtpc pcr1 r0-0)
(.mtpc pcr0 0)
(.mtpc pcr1 0)
(.sync.l)
(.sync.p)
(.mtc0 Perf v1-0)
@@ -95,10 +83,11 @@
(.sync.p)
(label cfg-2)
|#
0
(none)
)
(defmethod read! perf-stat ((this perf-stat))
(defmethod read! ((this perf-stat))
"Perfomance counters are partially implemented, they just count cycles."
(when (nonzero? (-> this ctrl))
(+! (-> this accum0) (- (get-cpu-clock) *pc-perf-stat-counter*))
@@ -106,8 +95,9 @@
)
#|
(b! (zero? (-> this ctrl)) cfg-2)
(.mtc0 Perf r0-0)
(local-vars (v1-1 int) (v1-3 int))
(b! (zero? (-> this ctrl)) cfg-2 :delay (nop!))
(.mtc0 Perf 0)
(.sync.l)
(.sync.p)
(.mfpc v1-1 pcr0)
@@ -116,10 +106,11 @@
(+! (-> this accum1) v1-3)
(label cfg-2)
|#
0
(none)
)
(defmethod update-wait-stats perf-stat ((this perf-stat) (arg0 uint) (arg1 uint) (arg2 uint))
(defmethod update-wait-stats ((this perf-stat) (arg0 uint) (arg1 uint) (arg2 uint))
(when (nonzero? (-> this ctrl))
(+! (-> this to-vu0-waits) arg0)
(+! (-> this to-spr-waits) arg1)
+3 -6
View File
@@ -14,17 +14,14 @@
)
(deftype viewer (process-drawable)
((janim art-joint-anim :offset-assert 176)
((janim art-joint-anim)
)
:heap-base #x50
:method-count-assert 20
:size-assert #xb4
:flag-assert #x14005000b4
(:states
viewer-process
)
)
(define-extern *viewer* viewer)
(defstate viewer-process (viewer)
@@ -172,7 +169,7 @@
)
)
(defmethod init-from-entity! viewer ((this viewer) (arg0 entity-actor))
(defmethod init-from-entity! ((this viewer) (arg0 entity-actor))
(set! *viewer* this)
(set! (-> this root) (new 'process 'trsqv))
(process-drawable-from-entity! this arg0)
+36 -61
View File
@@ -31,38 +31,30 @@
;; Most DMA stuff goes directly to the VIF, so this is the
;; most common.
(deftype dma-packet (structure)
((dma dma-tag :offset-assert 0)
(vif0 vif-tag :offset-assert 8)
(vif1 vif-tag :offset-assert 12) ;; doesn't have to be a vif tag.
(quad uint128 :offset 0)
((dma dma-tag)
(vif0 vif-tag)
(vif1 vif-tag)
(quad uint128 :overlay-at dma)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; seems to be unused? Also, it seems to be broken. Do not use this.
(deftype dma-packet-array (inline-array-class)
()
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
(set! (-> dma-packet-array heap-base) 16)
(set! (-> dma-packet-array heap-base) (the-as uint 16))
;; For doing a dma -> vif -> gif (path 2) transfer.
(deftype dma-gif-packet (structure)
((dma-vif dma-packet :inline :offset-assert 0)
(gif uint64 2 :offset-assert 16) ;; guess
((dma-vif dma-packet :inline)
(gif uint64 2)
;; these two were added to make it easier.
(gif0 uint64 :offset 16)
(gif1 uint64 :offset 24)
(quad uint128 2 :offset 0)
(gif0 uint64 :overlay-at (-> gif 0))
(gif1 uint64 :overlay-at (-> gif 1))
(quad uint128 2 :overlay-at (-> dma-vif dma))
)
:method-count-assert 9
:size-assert #x20
:flag-assert #x900000020
)
;; dma-buffer is a dynamically sized container for storing DMA data.
@@ -70,62 +62,55 @@
;; I added a data-buffer field that overlaps with data to get at the array of
;; bytes more easily.
(deftype dma-buffer (basic)
((allocated-length int32 :offset-assert 4) ;; number of bytes.
(base pointer :offset-assert 8) ;; first unused memory.
(end pointer :offset-assert 12) ;; ?? unused ??
(data uint64 1 :offset-assert 16) ;; start of memory.
(data-buffer uint8 :dynamic :offset 16) ;; the actual dynamic array backing it.
((allocated-length int32) ;; number of bytes.
(base pointer) ;; first unused memory.
(end pointer) ;; ?? unused ??
(data uint64 1) ;; start of memory.
(data-buffer uint8 :dynamic :overlay-at (-> data 0)) ;; the actual dynamic array backing it.
)
(:methods
(new (symbol type int) _type_ 0)
)
:method-count-assert 9
:size-assert #x18
:flag-assert #x900000018
(new (symbol type int) _type_)
)
)
(defmethod new dma-buffer ((allocation symbol) (type-to-make type) (arg0 int))
"Create a new dma-buffer with enough room to store arg0 bytes.
Note that this does not set the end field."
(let ((v0-0 (object-new allocation type-to-make
(+ (+ arg0 -4) (the-as int (-> type-to-make size)))
)
)
)
(let ((v0-0 (object-new allocation type-to-make (+ arg0 -4 (-> type-to-make size)))))
(set! (-> v0-0 base) (-> v0-0 data))
(set! (-> v0-0 allocated-length) arg0)
v0-0
)
)
(defun dma-buffer-inplace-new ((this dma-buffer) (size int))
(defun dma-buffer-inplace-new ((arg0 dma-buffer) (arg1 int))
"Create a dma-buffer in-place. Does not set the type of the dma-buffer object."
(set! (-> this base) (-> this data))
(set! (-> this allocated-length) size)
this
(set! (-> arg0 base) (-> arg0 data))
(set! (-> arg0 allocated-length) arg1)
arg0
)
(defmethod length dma-buffer ((this dma-buffer))
(defmethod length ((this dma-buffer))
"Get the amount of data the buffer can hold, in bytes."
(-> this allocated-length)
)
(defmethod asize-of dma-buffer ((this dma-buffer))
(defmethod asize-of ((this dma-buffer))
"Get the size in memory of the object"
(+ (+ (-> this allocated-length) -4) (the-as int (-> dma-buffer size)))
(+ (-> this allocated-length) -4 (-> dma-buffer size))
)
(defun dma-buffer-length ((arg0 dma-buffer))
"Get length used in quadwords, rounded down"
(shr (+ (&- (-> arg0 base) (-> arg0 data)) 15) 4)
(shr (+ (&- (-> arg0 base) (the-as uint (-> arg0 data))) 15) 4)
)
(defun dma-buffer-free ((arg0 dma-buffer))
"Get the number of free quadwords, rounded down, between base and end pointers."
(shr (+ (&- (-> arg0 end) (-> arg0 base)) 15) 4)
(shr (+ (&- (-> arg0 end) (the-as uint (-> arg0 base))) 15) 4)
)
(defmacro dma-buffer-add-base-type (buf pkt dma-type &rest body)
"Base macro for adding stuff to a dma-buffer. Don't use this directly!"
@@ -157,7 +142,6 @@
)
)
(defmacro dma-buffer-add-cnt-vif2 (buf qwc vif0 vif1)
"Add a dma-packet to a dma-buffer.
The packet is made up of a 'cnt' DMAtag (transfer qwc qwords of data after the tag and continue from after that point)
@@ -256,9 +240,9 @@
(new 'static 'vif-tag :cmd (vif-cmd mpg) :num (shl qwc-now 1) :imm origin)
)
;; increment by qwc-now quadwords.
(&+! func-ptr (shl qwc-now 4))
(&+! func-ptr (* qwc-now 16))
(set! qlen (- qlen qwc-now))
(+! origin (shl qwc-now 1))
(+! origin (* qwc-now 2))
)
)
)
@@ -268,29 +252,20 @@
(defun dma-buffer-send ((chan dma-bank) (buf dma-buffer))
"Send the DMA buffer! DOES NOT TRANSFER TAG, you probably want dma-buffer-send-chain instead."
(when (< (-> buf allocated-length)
(&- (-> buf base) (-> buf data))
)
(when (< (-> buf allocated-length) (&- (-> buf base) (-> buf data)))
;; oops. we overflowed the DMA buffer. die.
(segfault)
)
(dma-send chan
(the-as uint (-> buf data))
(the-as uint (dma-buffer-length buf))
)
(dma-send chan (the-as uint (-> buf data)) (the-as uint (dma-buffer-length buf)))
)
(defun dma-buffer-send-chain ((chan dma-bank-source) (buf dma-buffer))
"Send the DMA buffer! Sends the tags"
(when (< (-> buf allocated-length)
(&- (-> buf base) (-> buf data))
)
(when (< (-> buf allocated-length) (&- (-> buf base) (-> buf data)))
;; oops. we overflowed the DMA buffer. die.
(segfault)
)
(dma-send-chain chan
(the-as uint (-> buf data))
)
(dma-send-chain chan (the-as uint (-> buf data)))
)
(defmacro dma-buffer-add-gs-set-flusha (buf &rest reg-list)
+6 -9
View File
@@ -13,16 +13,13 @@
(declare-file (debug))
(deftype vif-disasm-element (structure)
((mask uint32 :offset-assert 0)
(tag vif-cmd-32 :offset-assert 4)
(val uint32 :offset-assert 8)
(print uint32 :offset-assert 12)
(string1 string :offset-assert 16)
(string2 string :offset-assert 20)
((mask uint32)
(tag vif-cmd-32)
(val uint32)
(print uint32)
(string1 string)
(string2 string)
)
:method-count-assert 9
:size-assert #x18
:flag-assert #x900000018
)
(define *vif-disasm-table*
+8 -47
View File
@@ -37,9 +37,6 @@
(str uint8 :offset 8 :size 1) ;; start!
(tag uint16 :offset 16)
)
:method-count-assert 9
:size-assert #x4
:flag-assert #x900000004
)
(defmethod inspect dma-chcr ((obj dma-chcr))
@@ -60,18 +57,12 @@
(madr uint32 :offset 16) ;; memory address
(qwc uint32 :offset 32) ;; quadword count
)
:method-count-assert 9
:size-assert #x24
:flag-assert #x900000024
)
;; DMA register layout for channels supporting source-chain
(deftype dma-bank-source (dma-bank)
((tadr uint32 :offset 48) ;; tag address
)
:method-count-assert 9
:size-assert #x34
:flag-assert #x900000034
)
;; The DMA source chain supports a two-entry "call stack" of tags.
@@ -80,9 +71,6 @@
((as0 uint32 :offset 64) ;; pushed tag register
(as1 uint32 :offset 80) ;; pushed tag register
)
:method-count-assert 9
:size-assert #x54
:flag-assert #x900000054
)
;; The toSPR and fromSPR DMA channels require a second address in the scratchpad.
@@ -90,9 +78,6 @@
(deftype dma-bank-spr (dma-bank-source)
((sadr uint32 :offset 128) ;; spad address.
)
:method-count-assert 9
:size-assert #x84
:flag-assert #x900000084
)
;; These addresses are the location of DMA banks for each channel.
@@ -120,15 +105,11 @@
(std uint8 :offset 6 :size 2)
(rcyc uint8 :offset 8 :size 3)
)
:method-count-assert 9
:size-assert #x4
:flag-assert #x900000004
)
;; D_ENABLEW, D_ENABLER?
(deftype dma-enable (uint32)
((cpnd uint8 :offset 16 :size 1))
:flag-assert #x900000004
)
;; D_SQWC
@@ -136,7 +117,6 @@
((sqwc uint8 :offset 0 :size 8)
(tqwc uint8 :offset 16 :size 8)
)
:flag-assert #x900000004
)
;; Shared DMA control registers.
@@ -151,29 +131,22 @@
(enabler uint32 :offset 5408)
(enablew uint32 :offset 5520)
)
:method-count-assert 9
:size-assert #x1594
:flag-assert #x900001594
)
(defconstant DMA_CONTROL_BANK (the dma-bank-control (get-vm-ptr #x1000e000)))
;; Seems to be unused. The vu-function type is used instead.
(deftype vu-code-block (basic)
((name basic :offset-assert 4)
(code uint32 :offset-assert 8)
(size int32 :offset-assert 12)
(dest-address uint32 :offset-assert 16)
((name basic)
(code uint32)
(size int32)
(dest-address uint32)
)
:method-count-assert 9
:size-assert #x14
:flag-assert #x900000014
)
;; ?? not sure what this is.
(deftype vu-stat (uint64)
()
:flag-assert #x900000008
)
@@ -201,9 +174,6 @@
(addr uint32 :offset 32 :size 31) ;; address (31 bits)
(spr uint8 :offset 63 :size 1) ;; spr or not flag.
)
:method-count-assert 9
:size-assert #x8
:flag-assert #x900000008
)
@@ -312,14 +282,11 @@
;; the addr field of their tag should point to the next bucket.
;; This is not a PS2 hardware thing
(deftype dma-bucket (structure)
((tag dma-tag :offset-assert 0) ;; the DMA tag to transfer the bucket's data
(last (pointer dma-tag) :offset-assert 8) ;; the last tag of this bucket.
(dummy uint32 :offset-assert 12) ;; empty space.
(next uint32 :offset 4) ;; this overlaps with the addr bit-field of the dma-tag
((tag dma-tag :offset-assert 0) ;; the DMA tag to transfer the bucket's data
(last (pointer dma-tag)) ;; the last tag of this bucket.
(dummy uint32) ;; empty space.
(next uint32 :offset 4) ;; this overlaps with the addr bit-field of the dma-tag
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; guess - VIF_MASK register?
@@ -341,7 +308,6 @@
(m14 uint8 :offset 28 :size 2)
(m15 uint8 :offset 30 :size 2)
)
:flag-assert #x900000004
)
;; the IMM field of a VIF STCYCL instruction
@@ -349,7 +315,6 @@
((cl uint8 :offset 0 :size 8)
(wl uint8 :offset 8 :size 8)
)
:flag-assert #x900000002
)
;; the IMM field of a VIF UNPACK instruction
@@ -358,7 +323,6 @@
(usn uint8 :offset 14 :size 1)
(flg uint8 :offset 15 :size 1)
)
:flag-assert #x900000002
)
@@ -422,9 +386,6 @@
(irq uint8 :offset 31 :size 1)
(msk uint8 :offset 28 :size 1)
)
:method-count-assert 9
:size-assert #x4
:flag-assert #x900000004
)
(defmethod inspect vif-tag ((obj vif-tag))
+8 -22
View File
@@ -19,39 +19,25 @@
;; may occur at any depth, and nothing has visibility ids.
(deftype draw-node (drawable)
((child-count uint8 :offset 6) ;; if our child requires a count
(flags uint8 :offset 7) ;; is our children leaf or draw-node?
(child drawable :offset 8) ;; can be draw-node or any other drawable
(distance float :offset 12) ;; used in shrub...
((child-count uint8 :offset 6)
(flags uint8 :offset 7)
(child drawable :offset 8)
(distance float :offset 12)
)
:method-count-assert 18
:size-assert #x20
:flag-assert #x1200000020
;; field distance is a float printed as hex?
)
;; for non-shrub uses of draw-node, this is used to store all the draw-nodes at a given depth.
(deftype drawable-inline-array-node (drawable-inline-array)
((data draw-node 1 :inline)
(pad uint32)
((data draw-node 1 :inline)
(pad uint32)
)
:method-count-assert 18
:size-assert #x44
:flag-assert #x1200000044
;; too many basic blocks
(:methods
)
)
;; the types of these fields are a guess for now.
;; used for draw-node-cull function
(deftype draw-node-dma (structure)
((banka draw-node 32 :inline :offset-assert 0)
(bankb draw-node 32 :inline :offset-assert 1024)
((banka draw-node 32 :inline)
(bankb draw-node 32 :inline)
)
:method-count-assert 9
:size-assert #x800
:flag-assert #x900000800
)
+18 -16
View File
@@ -19,7 +19,7 @@
;; 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 ((this draw-node) (arg0 int) (arg1 collide-list))
(defmethod collide-with-box ((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
@@ -34,7 +34,7 @@
(none)
)
(defmethod collide-y-probe draw-node ((this draw-node) (arg0 int) (arg1 collide-list))
(defmethod collide-y-probe ((this draw-node) (arg0 int) (arg1 collide-list))
(dotimes (s3-0 arg0)
(if (collide-cache-using-y-probe-test (-> this bsphere))
(collide-y-probe (-> this child) (the-as int (-> this child-count)) arg1)
@@ -45,17 +45,18 @@
(none)
)
(defmethod collide-ray draw-node ((this draw-node) (arg0 int) (arg1 collide-list))
(defmethod collide-ray ((this draw-node) (arg0 int) (arg1 collide-list))
(dotimes (s3-0 arg0)
(if (collide-cache-using-line-sphere-test (-> this bsphere))
(collide-ray (-> this child) (the-as int (-> this child-count)) arg1)
)
(&+! this 32)
)
0
(none)
)
(defmethod collect-ambients draw-node ((this draw-node) (arg0 sphere) (arg1 int) (arg2 ambient-list))
(defmethod collect-ambients ((this draw-node) (arg0 sphere) (arg1 int) (arg2 ambient-list))
(dotimes (s2-0 arg1)
(if (spheres-overlap? arg0 (the-as sphere (-> this bsphere)))
(collect-ambients (-> this child) arg0 (the-as int (-> this child-count)) arg2)
@@ -80,12 +81,12 @@
(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))
)
(format #t "~T [~D] ~A~%" s5-0 (-> this data s5-0))
)
this
)
(defmethod mem-usage drawable-inline-array-node ((this drawable-inline-array-node) (arg0 memory-usage-block) (arg1 int))
(defmethod mem-usage ((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")
@@ -97,30 +98,31 @@
this
)
(defmethod asize-of drawable-inline-array-node ((this drawable-inline-array-node))
(defmethod asize-of ((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 ((this drawable-inline-array-node) (arg0 int) (arg1 collide-list))
(defmethod collide-with-box ((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 (-> this data 0) (-> this length) arg1)
(collide-with-box (the-as drawable (-> this data)) (-> this length) arg1)
0
(none)
)
(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)
(defmethod collide-y-probe ((this drawable-inline-array-node) (arg0 int) (arg1 collide-list))
(collide-y-probe (the-as drawable (-> this data)) (-> this length) arg1)
0
(none)
)
(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)
(defmethod collide-ray ((this drawable-inline-array-node) (arg0 int) (arg1 collide-list))
(collide-ray (the-as drawable (-> this data)) (-> this length) arg1)
0
(none)
)
(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)
(defmethod collect-ambients ((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)
)
+6 -11
View File
@@ -14,28 +14,23 @@
;; the actual drawable is just a reference to the actor itself.
(deftype drawable-actor (drawable)
((actor entity-actor :offset 8)
((actor entity-actor :offset 8)
)
:method-count-assert 18
:size-assert #x20
:flag-assert #x1200000020
)
;; the tree of drawable-actors
(deftype drawable-tree-actor (drawable-tree)
()
:flag-assert #x1200000024
)
;; array of drawable-actor.
(deftype drawable-inline-array-actor (drawable-inline-array)
((data drawable-actor 1 :inline)
(pad uint8 4))
:flag-assert #x1200000044
((data drawable-actor 1 :inline)
(pad uint8 4)
)
)
(defmethod draw drawable-tree-actor ((this drawable-tree-actor) (arg0 drawable-tree-actor) (arg1 display-frame))
(defmethod draw ((this drawable-tree-actor) (arg0 drawable-tree-actor) (arg1 display-frame))
"Do nothing, actor data is not drawn."
0
(none)
)
+21 -33
View File
@@ -15,36 +15,31 @@
;; each ambient also has a simple drawable that just contains a reference to the entity.
;; this is basically only used to collect the currently active ambients.
(deftype drawable-ambient (drawable)
((ambient entity-ambient :offset 8)
((ambient entity-ambient :offset 8)
)
:method-count-assert 19
:size-assert #x20
:flag-assert #x1300000020
(:methods
(execute-ambient (_type_ vector) none 18)
(execute-ambient (_type_ vector) none)
)
)
;; a drawable-tree of all the ambients in a level.
(deftype drawable-tree-ambient (drawable-tree)
()
:method-count-assert 18
:size-assert #x24
:flag-assert #x1200000024
)
(deftype drawable-inline-array-ambient (drawable-inline-array)
((data drawable-ambient 1 :inline)
(pad uint32))
:flag-assert #x1200000044
((data drawable-ambient 1 :inline)
(pad uint32)
)
)
(defmethod draw drawable-tree-ambient ((this drawable-tree-ambient) (arg0 drawable-tree-ambient) (arg1 display-frame))
(defmethod draw ((this drawable-tree-ambient) (arg0 drawable-tree-ambient) (arg1 display-frame))
"Do nothing - ambients are not drawn."
0
(none)
)
(defmethod unpack-vis drawable-tree-ambient ((this drawable-tree-ambient) (arg0 (pointer int8)) (arg1 (pointer int8)))
(defmethod unpack-vis ((this drawable-tree-ambient) (arg0 (pointer int8)) (arg1 (pointer int8)))
"Do nothing - ambients do not use vis."
arg1
)
@@ -55,23 +50,19 @@
;; - daxter audio (sidekick)
;; - voicebox audio (also called sidekick in some places...)
(deftype level-hint (process)
((text-id-to-display text-id :offset-assert 112)
(sound-to-play string :offset-assert 116)
(trans vector :offset-assert 120)
(sound-id sound-id :offset-assert 124)
(mode symbol :offset-assert 128)
(total-time time-frame :offset-assert 136)
(total-off-time time-frame :offset-assert 144)
(last-time time-frame :offset-assert 152)
(voicebox handle :offset-assert 160)
((text-id-to-display text-id)
(sound-to-play string)
(trans vector)
(sound-id sound-id)
(mode symbol)
(total-time time-frame)
(total-off-time time-frame)
(last-time time-frame)
(voicebox handle)
)
:heap-base #x40
:method-count-assert 16
:size-assert #xa8
:flag-assert #x10004000a8
(:methods
(print-text (_type_) none 14)
(appeared-for-long-enough? (_type_) symbol 15)
(print-text (_type_) none)
(appeared-for-long-enough? (_type_) symbol)
)
(:states
(level-hint-ambient-sound string)
@@ -84,12 +75,9 @@
;; a list of ambients that are currently active.
(deftype ambient-list (structure)
((num-items int32 :offset-assert 0)
(items drawable-ambient 2048 :offset-assert 4)
((num-items int32)
(items drawable-ambient 2048)
)
:method-count-assert 9
:size-assert #x2004
:flag-assert #x900002004
)
@@ -13,14 +13,15 @@
;; note that in general you shouldn't assume that calling "draw" on a group will actually call "draw" on all the members -
;; different children classes may specialize these methods. (same goes for all the methods)
;; decomp begins
(deftype drawable-group (drawable)
((length int16 :offset 6)
(data drawable 1 :offset-assert 32) ;; note that you get 1 drawable in the type, the rest run off the end.
((length int16 :offset 6)
(data drawable 1) ;; note that you get 1 drawable in the type, the rest run off the end.
)
(:methods
(new (symbol type int) _type_)
)
:flag-assert #x1200000024
)
;; unused
+14 -23
View File
@@ -9,11 +9,7 @@
(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
(the-as int (+ (-> type-to-make size) (* (+ arg0 -1) 4)))
)
)
)
(let ((v0-0 (object-new allocation type-to-make (the-as int (+ (-> type-to-make size) (* (+ arg0 -1) 4))))))
(set! (-> v0-0 length) arg0)
v0-0
)
@@ -30,7 +26,7 @@
this
)
(defmethod print drawable-group ((this drawable-group))
(defmethod print ((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))
@@ -39,15 +35,15 @@
this
)
(defmethod length drawable-group ((this drawable-group))
(defmethod length ((this drawable-group))
(-> this length)
)
(defmethod asize-of drawable-group ((this drawable-group))
(defmethod asize-of ((this drawable-group))
(the-as int (+ (-> drawable-group size) (* (+ (-> this length) -1) 4)))
)
(defmethod mem-usage drawable-group ((this drawable-group) (arg0 memory-usage-block) (arg1 int))
(defmethod mem-usage ((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)
@@ -61,18 +57,18 @@
this
)
(defmethod login drawable-group ((this drawable-group))
(defmethod login ((this drawable-group))
(dotimes (s5-0 (-> this length))
(login (-> this data s5-0))
)
this
)
(defmethod draw drawable-group ((this drawable-group) (arg0 drawable-group) (arg1 display-frame))
(defmethod draw ((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)
(draw (-> this data s3-0) (-> arg0 data s3-0) arg1)
)
)
)
@@ -80,7 +76,7 @@
(none)
)
(defmethod collect-stats drawable-group ((this drawable-group))
(defmethod collect-stats ((this drawable-group))
(when (vis-cull (-> this id))
(when (sphere-cull (-> this bsphere))
(dotimes (s5-0 (-> this length))
@@ -92,16 +88,11 @@
(none)
)
(defmethod debug-draw drawable-group ((this drawable-group) (arg0 drawable) (arg1 display-frame))
(defmethod debug-draw ((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
)
(debug-draw (-> this data s3-0) (-> (the-as drawable-group arg0) data s3-0) arg1)
)
)
)
@@ -109,9 +100,9 @@
(none)
)
(defmethod unpack-vis drawable-group ((this drawable-group) (arg0 (pointer int8)) (arg1 (pointer int8)))
(dotimes (s4-0 (-> this length) arg1)
(defmethod unpack-vis ((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
)
)
+12 -25
View File
@@ -20,40 +20,30 @@
;; 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
((id int16) ;; ID number for visibility (not always used)
(bsphere vector :inline) ;; bounding sphere
)
:method-count-assert 18
:size-assert #x20
:flag-assert #x1200000020
(:methods
;; initialize the drawable after it has been loaded.
(login (_type_) _type_ 9)
(login (_type_) _type_)
;; do some sort of drawing... this really does different things for different types.
(draw (_type_ _type_ display-frame) none 10)
(draw (_type_ _type_ display-frame) none)
;; add collision meshes to the given collide list if they intersect the bounding box in *collide-work*
;; the integer argument can be used to call this method on an inline-array of drawables (only some support this)
;; this avoids the dynamic dispatch on each element of the array.
(collide-with-box (_type_ int collide-list) none 11)
(collide-with-box (_type_ int collide-list) none)
;; similar to above, but only add if the collision mesh intersects with a "y probe"
(collide-y-probe (_type_ int collide-list) none 12)
(collide-y-probe (_type_ int collide-list) none)
;; similar to above, but only add if the collision mesh intersects a ray of spheres.
(collide-ray (_type_ int collide-list) none 13)
(collide-ray (_type_ int collide-list) none)
;; different for different types, but generally collects debug statistics like numbers of triangles
(collect-stats (_type_) none 14)
(collect-stats (_type_) none)
;; different for different types, but usually does nothing.
(debug-draw (_type_ drawable display-frame) none 15)
(debug-draw (_type_ drawable display-frame) none)
;; given VIS data (uncompressed), compute the visiblity bit string.
(unpack-vis (_type_ (pointer int8) (pointer int8)) (pointer int8) 16)
(unpack-vis (_type_ (pointer int8) (pointer int8)) (pointer int8))
;; find "ambients" inside the given sphere and add to list.
(collect-ambients (_type_ sphere int ambient-list) none 17)
(collect-ambients (_type_ sphere int ambient-list) none)
)
)
@@ -61,11 +51,8 @@
;; A drawable that simply draws a sphere and an error message at the origin of the bounding sphere.
(deftype drawable-error (drawable)
((name string :offset-assert 32)
((name string)
)
:method-count-assert 18
:size-assert #x24
:flag-assert #x1200000024
)
(declare-type process-drawable process)
@@ -15,9 +15,6 @@
;; DECOMP BEGINS
(deftype drawable-inline-array (drawable)
((length int16 :offset 6)
((length int16 :offset 6)
)
:method-count-assert 18
:size-assert #x20
:flag-assert #x1200000020
)
@@ -9,24 +9,25 @@
;; DECOMP BEGINS
(defmethod length drawable-inline-array ((this drawable-inline-array))
(defmethod length ((this drawable-inline-array))
(-> this length)
)
(defmethod login drawable-inline-array ((this drawable-inline-array))
(defmethod login ((this drawable-inline-array))
this
)
(defmethod draw drawable-inline-array ((this drawable-inline-array) (arg0 drawable-inline-array) (arg1 display-frame))
(none)
)
(defmethod collect-stats drawable-inline-array ((this drawable-inline-array))
(defmethod draw ((this drawable-inline-array) (arg0 drawable-inline-array) (arg1 display-frame))
0
(none)
)
(defmethod debug-draw drawable-inline-array ((this drawable-inline-array) (arg0 drawable) (arg1 display-frame))
(defmethod collect-stats ((this drawable-inline-array))
0
(none)
)
(defmethod debug-draw ((this drawable-inline-array) (arg0 drawable) (arg1 display-frame))
0
(none)
)
+2 -3
View File
@@ -11,12 +11,11 @@
;; for example, there might be a drawable-tree for all the tfrags, one for all the ties, etc.
(deftype drawable-tree (drawable-group)
()
:flag-assert #x1200000024
)
;; a drawable-tree-array contains all the drawable-trees in a level.
;; usually there aren't too many drawable trees (~5-15)
(deftype drawable-tree-array (drawable-group)
((trees drawable-tree 1 :offset 32))
:flag-assert #x1200000024
((trees drawable-tree 1 :overlay-at (-> data 0))
)
)
+13 -11
View File
@@ -13,38 +13,40 @@
;; DECOMP BEGINS
(defmethod draw drawable-tree-array ((this drawable-tree-array) (arg0 drawable-tree-array) (arg1 display-frame))
(defmethod draw ((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 (-> this length))
(draw (-> this trees s3-0) (-> arg0 trees s3-0) arg1)
)
)
(('special 'special-vis #f)
)
(else
(dotimes (s3-0 (-> this length))
(draw (-> this trees s3-0) (-> arg0 trees s3-0) arg1)
)
)
)
)
0
(none)
)
(defmethod collect-stats drawable-tree-array ((this drawable-tree-array))
(defmethod collect-stats ((this drawable-tree-array))
(dotimes (s5-0 (-> this length))
(collect-stats (-> this trees s5-0))
)
0
(none)
)
(defmethod debug-draw drawable-tree-array ((this drawable-tree-array) (arg0 drawable) (arg1 display-frame))
(defmethod debug-draw ((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)
)
(defmethod unpack-vis drawable-tree ((this drawable-tree) (arg0 (pointer int8)) (arg1 (pointer int8)))
(defmethod unpack-vis ((this drawable-tree) (arg0 (pointer int8)) (arg1 (pointer int8)))
"Copy our visibility data from arg1 to arg0, unpacking it."
(local-vars (t5-1 int))
+10 -10
View File
@@ -149,51 +149,51 @@
(none)
)
(defmethod login drawable ((this drawable))
(defmethod login ((this drawable))
this
)
(defmethod draw drawable ((this drawable) (arg0 drawable) (arg1 display-frame))
(defmethod draw ((this drawable) (arg0 drawable) (arg1 display-frame))
0
(none)
)
(defmethod collide-with-box drawable ((this drawable) (arg0 int) (arg1 collide-list))
(defmethod collide-with-box ((this drawable) (arg0 int) (arg1 collide-list))
0
(none)
)
(defmethod collide-y-probe drawable ((this drawable) (arg0 int) (arg1 collide-list))
(defmethod collide-y-probe ((this drawable) (arg0 int) (arg1 collide-list))
0
(none)
)
(defmethod collide-ray drawable ((this drawable) (arg0 int) (arg1 collide-list))
(defmethod collide-ray ((this drawable) (arg0 int) (arg1 collide-list))
0
(none)
)
(defmethod collect-ambients drawable ((this drawable) (arg0 sphere) (arg1 int) (arg2 ambient-list))
(defmethod collect-ambients ((this drawable) (arg0 sphere) (arg1 int) (arg2 ambient-list))
0
(none)
)
(defmethod collect-stats drawable ((this drawable))
(defmethod collect-stats ((this drawable))
0
(none)
)
(defmethod debug-draw drawable ((this drawable) (arg0 drawable) (arg1 display-frame))
(defmethod debug-draw ((this drawable) (arg0 drawable) (arg1 display-frame))
0
(none)
)
(defmethod draw drawable-error ((this drawable-error) (arg0 drawable-error) (arg1 display-frame))
(defmethod draw ((this drawable-error) (arg0 drawable-error) (arg1 display-frame))
(error-sphere arg0 (-> arg0 name))
(none)
)
(defmethod unpack-vis drawable ((this drawable) (arg0 (pointer int8)) (arg1 (pointer int8)))
(defmethod unpack-vis ((this drawable) (arg0 (pointer int8)) (arg1 (pointer int8)))
arg1
)
+66 -75
View File
@@ -38,14 +38,11 @@
;; These terminate on both ends with #f.
(deftype connectable (structure)
((next0 connectable :offset-assert 0)
(prev0 connectable :offset-assert 4)
(next1 connectable :offset-assert 8)
(prev1 connectable :offset-assert 12)
((next0 connectable)
(prev0 connectable)
(next1 connectable)
(prev1 connectable)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
@@ -60,27 +57,22 @@
(declare-type engine basic)
(deftype connection (connectable)
((param0 basic :offset-assert 16) ;; often (function object object object object object)
(param1 int32 :offset-assert 20)
(param2 int32 :offset-assert 24)
(param3 int32 :offset-assert 28)
(quad uint128 2 :offset 0)
((param0 basic)
(param1 int32)
(param2 int32)
(param3 int32)
(quad uint128 2 :overlay-at next0)
)
:method-count-assert 14
:size-assert #x20
:flag-assert #xe00000020
;; the params are loaded with a signed load, which is kinda weird...
(:methods
(print (connection) _type_ 2)
(get-engine (connection) engine 9)
(get-process (connection) process 10)
(belongs-to-engine? (connection engine) symbol 11)
(belongs-to-process? (connection process) symbol 12)
(move-to-dead (connection) connection 13)
(get-engine (connection) engine)
(get-process (connection) process)
(belongs-to-engine? (connection engine) symbol)
(belongs-to-process? (connection process) symbol)
(move-to-dead (connection) connection)
)
)
(defmethod inspect connection ((this connection))
(defmethod inspect ((this connection))
(format #t "[~8x] ~A~%" this 'connection)
(format #t "~Tnext0: ~`connectable`P~%" (-> this next0))
(format #t "~Tprev0: ~`connectable`P~%" (-> this prev0))
@@ -102,50 +94,49 @@
;; you can iterate over the connections, or run them.
;; the engine is dynamically sized based on how many connections it can store.
(deftype engine (basic)
((name basic :offset-assert 4)
(length int16 :offset-assert 8) ;; in use elts of the data array
(allocated-length int16 :offset-assert 10) ;; size of the data array
(engine-time time-frame :offset-assert 16) ;; frame that we last executed
((name basic)
(length int16)
(allocated-length int16)
(engine-time time-frame) ;; frame that we last executed
;; terminating nodes for the next0/prev0 linked lists
(alive-list connectable :inline :offset-assert 32)
(alive-list-end connectable :inline :offset-assert 48)
(dead-list connectable :inline :offset-assert 64)
(dead-list-end connectable :inline :offset-assert 80)
(alive-list connectable :inline)
(alive-list-end connectable :inline)
(dead-list connectable :inline)
(dead-list-end connectable :inline)
;; storage for nodes. this is dynamically sized.
(data connection 1 :inline :offset-assert 96)
(data connection 1 :inline)
)
:method-count-assert 24
:size-assert #x80
:flag-assert #x1800000080
(:methods
(new (symbol type basic int) _type_ 0)
(inspect-all-connections (engine) engine 9)
(apply-to-connections (engine (function connectable none)) int 10)
(apply-to-connections-reverse (engine (function connectable none)) int 11)
(execute-connections (engine object) int 12)
(execute-connections-and-move-to-dead (engine object) int 13)
(execute-connections-if-needed (engine object) int 14)
(add-connection (engine process object object object object) connection 15)
(remove-from-process (engine process) int 16)
(remove-matching (engine (function connection engine symbol)) int 17)
(remove-all (engine) int 18)
(remove-by-param1 (engine object) int 19)
(remove-by-param2 (engine int) int 20)
(get-first-connectable (engine) connectable 21)
(get-last-connectable (engine) connectable 22)
(unknown-1 (engine (pointer uint32)) uint 23)
(new (symbol type basic int) _type_)
(inspect-all-connections (engine) engine)
(apply-to-connections (engine (function connectable none)) int)
(apply-to-connections-reverse (engine (function connectable none)) int)
(execute-connections (engine object) int)
(execute-connections-and-move-to-dead (engine object) int)
(execute-connections-if-needed (engine object) int)
(add-connection (engine process object object object object) connection)
(remove-from-process (engine process) int)
(remove-matching (engine (function connection engine symbol)) int)
(remove-all (engine) int)
(remove-by-param1 (engine object) int)
(remove-by-param2 (engine int) int)
(get-first-connectable (engine) connectable)
(get-last-connectable (engine) connectable)
(unknown-1 (engine (pointer uint32)) uint)
)
)
(defmethod belongs-to-process? connection ((this connection) (arg0 process))
(defmethod belongs-to-process? ((this connection) (arg0 process))
"Does this connection belong to the given process?"
(= arg0 ((method-of-type connection get-process) this))
)
(defmethod print connection ((this connection))
(defmethod print ((this connection))
"Print a connection and its parameters"
(format #t "#<connection (~A ~A ~A ~A) @ #x~X>"
(-> this param0)
@@ -157,7 +148,7 @@
this
)
(defmethod get-engine connection ((this connection))
(defmethod get-engine ((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.
@@ -170,7 +161,7 @@
(the-as engine (&+ this -28))
)
(defmethod get-process connection ((this connection))
(defmethod get-process ((this connection))
"Get the process for this connection"
;; same trick as get-engine, but backs up using prev1 until we hit the process.
@@ -183,7 +174,7 @@
(the-as process (&+ this -92))
)
(defmethod belongs-to-engine? connection ((this connection) (arg0 engine))
(defmethod belongs-to-engine? ((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.
@@ -192,19 +183,19 @@
)
)
(defmethod get-first-connectable engine ((this engine))
(defmethod get-first-connectable ((this engine))
"Get the first connectable on the alive list.
This should be a valid connection."
(-> this alive-list next0)
)
(defmethod get-last-connectable engine ((this engine))
(defmethod get-last-connectable ((this engine))
"Get the last connectable on the alive list.
I think the returned connectable is invalid."
(-> this alive-list-end)
)
(defmethod unknown-1 engine ((this engine) (arg0 (pointer uint32)))
(defmethod unknown-1 ((this engine) (arg0 (pointer uint32)))
"Not clear what this does. Possibly get next."
(the-as uint32 (-> arg0 0))
)
@@ -268,13 +259,13 @@
this
)
(defmethod print engine ((this engine))
(defmethod print ((this engine))
"Print an engine and its name"
(format #t "#<~A ~A @ #x~X>" (-> this type) (-> this name) this)
this
)
(defmethod inspect engine ((this engine))
(defmethod inspect ((this engine))
(format #t "[~8x] ~A~%" this (-> this type))
(format #t "~Tname: ~A~%" (-> this name))
(format #t "~Tengine-time: ~D~%" (-> this engine-time))
@@ -308,19 +299,19 @@
this
)
(defmethod length engine ((this engine))
(defmethod length ((this engine))
"Get the in-use length of an engine"
(-> this length)
)
(defmethod asize-of engine ((this engine))
(defmethod asize-of ((this engine))
"Get the size in memory of an engine"
(the-as int
(+ (-> engine size) (the-as uint (shl (+ (-> this allocated-length) -1) 5)))
)
)
(defmethod apply-to-connections engine ((this engine) (f (function connectable none)))
(defmethod apply-to-connections ((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 (-> this alive-list next0))
;; need to get this _before_ running f, in case we remove.
@@ -335,7 +326,7 @@
0
)
(defmethod apply-to-connections-reverse engine ((this engine) (f (function connectable none)))
(defmethod apply-to-connections-reverse ((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 (-> this alive-list-end prev0)))
@@ -347,7 +338,7 @@
0
)
(defmethod execute-connections engine ((this engine) (arg0 object))
(defmethod execute-connections ((this engine) (arg0 object))
"Run the engine!"
;; remember when
@@ -364,7 +355,7 @@
0
)
(defmethod execute-connections-and-move-to-dead engine ((this engine) (arg0 object))
(defmethod execute-connections-and-move-to-dead ((this engine) (arg0 object))
"Run the engine! If any objects return 'dead, then remove them"
(set! (-> this engine-time) (-> *display* real-frame-counter))
(let ((ct (the-as connection (-> this alive-list-end prev0))))
@@ -383,7 +374,7 @@
0
)
(defmethod execute-connections-if-needed engine ((this engine) (arg0 object))
(defmethod execute-connections-if-needed ((this engine) (arg0 object))
"Execute connections, but only if it hasn't been done on this frame."
(when (!= (-> *display* real-frame-counter) (-> this engine-time))
(execute-connections this arg0)
@@ -405,7 +396,7 @@
)
(when *debug-segment*
(defmethod inspect-all-connections engine ((this engine))
(defmethod inspect-all-connections ((this engine))
"inspect all of the connections."
(apply-to-connections this
(the (function connection none) (method-of-type connection inspect)))
@@ -458,7 +449,7 @@
)
(defmethod move-to-dead connection ((this connection))
(defmethod move-to-dead ((this connection))
"Move this connection from the alive list to the dead list"
(local-vars (v1-1 engine))
;; get our engine
@@ -496,7 +487,7 @@
(set! v0-1 0)
)
(defmethod remove-from-process engine ((this engine) (proc process))
(defmethod remove-from-process ((this engine) (proc process))
"Remove all connections from process for this engine"
(local-vars (iter connection))
(when proc
@@ -512,7 +503,7 @@
)
0)
(defmethod remove-matching engine ((this engine) (arg0 (function connection engine symbol)))
(defmethod remove-matching ((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
@@ -531,7 +522,7 @@
)
0)
(defmethod remove-all engine ((this engine))
(defmethod remove-all ((this engine))
"Remove all connections from an engine"
(local-vars
(a0-1 connectable)
@@ -547,7 +538,7 @@
)
0)
(defmethod remove-by-param1 engine ((this engine) (p1-value object))
(defmethod remove-by-param1 ((this engine) (p1-value object))
"Remove all connections with param1 matching arg0"
(let* ((current (-> this alive-list next0))
(next (-> current next0))
@@ -563,7 +554,7 @@
0
)
(defmethod remove-by-param2 engine ((this engine) (p2-value int))
(defmethod remove-by-param2 ((this engine) (p2-value int))
"Remove all connections with param2 matching p2-value"
(let* ((current (-> this alive-list next0))
(next (-> current next0))
+38 -41
View File
@@ -62,32 +62,29 @@
;; These are allocated on the process heap of the entity's process.
(deftype actor-link-info (basic)
((process process :offset-assert 4) ;; process for this entity
(next entity-actor :offset-assert 8) ;; next entity in the list
(prev entity-actor :offset-assert 12) ;; prev entity in the list
((process process)
(next entity-actor)
(prev entity-actor)
)
:method-count-assert 26
:size-assert #x10
:flag-assert #x1a00000010
(:methods
(new (symbol type process) _type_ 0)
(get-matching-actor-type-mask (_type_ type) int 9)
(actor-count-before (_type_) int 10)
(link-to-next-and-prev-actor (_type_) entity-actor 11)
(get-next (_type_) entity-actor 12)
(get-prev (_type_) entity-actor 13)
(get-next-process (_type_) process 14)
(get-prev-process (_type_) process 15)
(apply-function-forward (_type_ (function entity-actor object object) object) int 16)
(apply-function-reverse (_type_ (function entity-actor object object) object) int 17)
(apply-all (_type_ (function entity-actor object object) object) int 18)
(send-to-all (_type_ symbol) none 19)
(send-to-all-after (_type_ symbol) object 20)
(send-to-all-before (_type_ symbol) object 21)
(send-to-next-and-prev (_type_ symbol) none 22)
(send-to-next (_type_ symbol) none 23)
(send-to-prev (_type_ symbol) none 24)
(actor-count (_type_) int 25)
(new (symbol type process) _type_)
(get-matching-actor-type-mask (_type_ type) int)
(actor-count-before (_type_) int)
(link-to-next-and-prev-actor (_type_) entity-actor)
(get-next (_type_) entity-actor)
(get-prev (_type_) entity-actor)
(get-next-process (_type_) process)
(get-prev-process (_type_) process)
(apply-function-forward (_type_ (function entity-actor object object) object) int)
(apply-function-reverse (_type_ (function entity-actor object object) object) int)
(apply-all (_type_ (function entity-actor object object) object) int)
(send-to-all (_type_ symbol) none)
(send-to-all-after (_type_ symbol) object)
(send-to-all-before (_type_ symbol) object)
(send-to-next-and-prev (_type_ symbol) none)
(send-to-next (_type_ symbol) none)
(send-to-prev (_type_ symbol) none)
(actor-count (_type_) int)
)
)
@@ -95,14 +92,14 @@
;; Link Setup
;;;;;;;;;;;;;;;;
(defmethod next-actor entity-actor ((this entity-actor))
(defmethod next-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 this 'next-actor 0)
)
(defmethod prev-actor entity-actor ((this entity-actor))
(defmethod prev-actor ((this entity-actor))
"Look up previous actor in the list"
(declare (inline))
(entity-actor-lookup this 'prev-actor 0)
@@ -126,26 +123,26 @@
;;;;;;;;;;;;;;;;;;;;
;; 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 ((this actor-link-info))
(defmethod get-next ((this actor-link-info))
(-> this next)
)
(defmethod get-prev actor-link-info ((this actor-link-info))
(defmethod get-prev ((this actor-link-info))
(-> this prev)
)
(defmethod get-next-process actor-link-info ((this actor-link-info))
(defmethod get-next-process ((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 (-> this next) (-> this next extra process)))
)
(defmethod get-prev-process actor-link-info ((this actor-link-info))
(defmethod get-prev-process ((this actor-link-info))
"Get the process for the prev, if it exists"
(the-as process (and (-> this prev) (-> this prev extra process)))
)
(defmethod link-to-next-and-prev-actor actor-link-info ((this actor-link-info))
(defmethod link-to-next-and-prev-actor ((this actor-link-info))
"Redo the linking in the constructor by looking up the next/prev actor."
(set! (-> this next) (next-actor (-> this process entity)))
(set! (-> this prev) (prev-actor (-> this process entity)))
@@ -183,7 +180,7 @@
0
)
(defmethod apply-all actor-link-info ((this actor-link-info) (arg0 (function entity-actor object object)) (arg1 object))
(defmethod apply-all ((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 (-> this process entity)))
@@ -204,7 +201,7 @@
0
)
(defmethod send-to-all-after actor-link-info ((this actor-link-info) (message symbol))
(defmethod send-to-all-after ((this actor-link-info) (message symbol))
"Send an event to all processes after this link with no parameters."
(let ((iter (-> this next))
@@ -221,7 +218,7 @@
)
)
(defmethod send-to-all-before actor-link-info ((this actor-link-info) (message symbol))
(defmethod send-to-all-before ((this actor-link-info) (message symbol))
"Send an event to all processes before this link with no parameters."
(let ((iter (-> this prev))
@@ -238,7 +235,7 @@
)
)
(defmethod send-to-next actor-link-info ((this actor-link-info) (message symbol))
(defmethod send-to-next ((this actor-link-info) (message symbol))
"Send event arg0 to the next actor's process"
(let ((a0-1 (-> this next)))
@@ -256,7 +253,7 @@
(none)
)
(defmethod send-to-prev actor-link-info ((this actor-link-info) (message symbol))
(defmethod send-to-prev ((this actor-link-info) (message symbol))
"Send event arg1 to the next actor's process."
(let ((a0-1 (-> this prev)))
@@ -271,7 +268,7 @@
(none)
)
(defmethod send-to-next-and-prev actor-link-info ((this actor-link-info) (msg symbol))
(defmethod send-to-next-and-prev ((this actor-link-info) (msg symbol))
"Send an event to both next and prev with no params."
(send-to-next this msg)
@@ -279,13 +276,13 @@
(none)
)
(defmethod send-to-all actor-link-info ((this actor-link-info) (msg symbol))
(defmethod send-to-all ((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 ((this actor-link-info))
(defmethod actor-count ((this actor-link-info))
"Count the number of actors in the entire list"
(let ((actor (-> this process entity))
(count 0)
@@ -303,7 +300,7 @@
)
)
(defmethod get-matching-actor-type-mask actor-link-info ((this actor-link-info) (matching-type type))
(defmethod get-matching-actor-type-mask ((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 (-> this process entity)))
@@ -332,7 +329,7 @@
)
)
(defmethod actor-count-before actor-link-info ((this actor-link-info))
(defmethod actor-count-before ((this actor-link-info))
"Get the number of actors _before_ this actor in the list."
(let* ((this-actor (-> this process entity))
(actor this-actor)
+10 -10
View File
@@ -10,7 +10,7 @@
;; DECOMP BEGINS
(defmethod mem-usage drawable-ambient ((this drawable-ambient) (arg0 memory-usage-block) (arg1 int))
(defmethod mem-usage ((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)
@@ -22,7 +22,7 @@
(the-as drawable-ambient 0)
)
(defmethod mem-usage drawable-inline-array-ambient ((this drawable-inline-array-ambient) (arg0 memory-usage-block) (arg1 int))
(defmethod mem-usage ((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)
@@ -362,7 +362,7 @@
(none)
)
(defmethod print-text level-hint ((this level-hint))
(defmethod print-text ((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))
@@ -382,7 +382,7 @@
(none)
)
(defmethod appeared-for-long-enough? level-hint ((this level-hint))
(defmethod appeared-for-long-enough? ((this level-hint))
(and (!= (-> this next-state name) 'level-hint-sidekick) (< (seconds 5) (-> this total-time)))
)
@@ -971,7 +971,7 @@
(none)
)
(defmethod collect-ambients drawable-ambient ((this drawable-ambient) (arg0 sphere) (arg1 int) (arg2 ambient-list))
(defmethod collect-ambients ((this drawable-ambient) (arg0 sphere) (arg1 int) (arg2 ambient-list))
(dotimes (s2-0 arg1)
(when (spheres-overlap? arg0 (the-as sphere (-> this bsphere)))
(set! (-> arg2 items (-> arg2 num-items)) this)
@@ -983,19 +983,19 @@
(none)
)
(defmethod collect-ambients drawable-inline-array-ambient ((this drawable-inline-array-ambient) (arg0 sphere) (arg1 int) (arg2 ambient-list))
(defmethod collect-ambients ((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 ((this drawable-tree-ambient) (arg0 sphere) (arg1 int) (arg2 ambient-list))
(defmethod collect-ambients ((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 ((this entity-ambient))
(defmethod birth-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)
@@ -1091,7 +1091,7 @@
(define *execute-ambients* #t)
(defmethod execute-ambient drawable-ambient ((this drawable-ambient) (arg0 vector))
(defmethod execute-ambient ((this drawable-ambient) (arg0 vector))
((-> this ambient ambient-data function) this arg0)
0
(none)
@@ -1099,7 +1099,7 @@
;; ERROR: function was not converted to expressions. Cannot decompile.
(defmethod draw-debug entity-ambient ((this entity-ambient))
(defmethod draw-debug ((this entity-ambient))
(local-vars (sv-16 uint128))
(let ((gp-0 (-> this trans))
(s5-0 (res-lump-struct this 'type symbol))

Some files were not shown because too many files have changed in this diff Show More