mirror of
https://github.com/open-goal/jak-project
synced 2026-05-23 06:54:31 -04:00
d/jak2: mostly finish mysql-nav-graph and fix docstring handling around with-pp/local-vars (#1869)
This commit is contained in:
@@ -46,6 +46,10 @@ goos::Object to_symbol(const std::string& str) {
|
||||
return goos::SymbolObject::make_new(get_pretty_printer_reader().symbolTable, str);
|
||||
}
|
||||
|
||||
goos::Object new_string(const std::string& str) {
|
||||
return goos::StringObject::make_new(str);
|
||||
}
|
||||
|
||||
goos::Object build_list(const std::string& str) {
|
||||
return build_list(to_symbol(str));
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ namespace pretty_print {
|
||||
// string -> object (as a symbol)
|
||||
goos::Object to_symbol(const std::string& str);
|
||||
|
||||
goos::Object new_string(const std::string& str);
|
||||
|
||||
// list with a single symbol from a string
|
||||
goos::Object build_list(const std::string& str);
|
||||
|
||||
|
||||
@@ -27,19 +27,41 @@ void append_body_to_function_definition(goos::Object* top_form,
|
||||
const std::vector<goos::Object>& inline_body,
|
||||
const FunctionVariableDefinitions& var_dec,
|
||||
const TypeSpec& ts) {
|
||||
if (var_dec.local_vars) {
|
||||
pretty_print::append(*top_form, pretty_print::build_list(*var_dec.local_vars));
|
||||
// Some forms like docstrings and local-vars we _always_ want to be at the top level and first (in
|
||||
// the order added)
|
||||
std::vector<goos::Object> initial_top_level_forms;
|
||||
|
||||
std::vector<goos::Object> body_elements;
|
||||
body_elements.insert(body_elements.end(), inline_body.begin(), inline_body.end());
|
||||
// If the first element in the body is a docstring, add it first
|
||||
if (body_elements.size() > 0 && body_elements.at(0).is_string()) {
|
||||
initial_top_level_forms.push_back(inline_body.at(0));
|
||||
body_elements.erase(body_elements.begin());
|
||||
}
|
||||
|
||||
// add local vars if applicable
|
||||
if (var_dec.local_vars) {
|
||||
initial_top_level_forms.push_back(*var_dec.local_vars);
|
||||
}
|
||||
|
||||
std::vector<goos::Object> final_body;
|
||||
for (const auto& elem : initial_top_level_forms) {
|
||||
final_body.push_back(elem);
|
||||
}
|
||||
// If the form contains the ppointer and isn't a behavior, we need to wrap the body in `with-pp`
|
||||
if (var_dec.had_pp && !ts.try_get_tag("behavior")) {
|
||||
std::vector<goos::Object> body_with_pp;
|
||||
body_with_pp.push_back(pretty_print::to_symbol("with-pp"));
|
||||
body_with_pp.insert(body_with_pp.end(), inline_body.begin(), inline_body.end());
|
||||
pretty_print::append(*top_form,
|
||||
pretty_print::build_list(pretty_print::build_list(body_with_pp)));
|
||||
body_with_pp.insert(body_with_pp.end(), body_elements.begin(), body_elements.end());
|
||||
final_body.push_back(pretty_print::build_list(body_with_pp));
|
||||
} else {
|
||||
pretty_print::append(*top_form, pretty_print::build_list(inline_body));
|
||||
// otherwise, just construct the form from the body
|
||||
for (const auto& elem : body_elements) {
|
||||
final_body.push_back(elem);
|
||||
}
|
||||
}
|
||||
|
||||
pretty_print::append(*top_form, pretty_print::build_list(final_body));
|
||||
}
|
||||
} // namespace
|
||||
|
||||
@@ -113,10 +135,9 @@ std::string final_defun_out(const Function& func,
|
||||
|
||||
// docstring if available
|
||||
if (dts.symbol_metadata_map.count(func.name()) != 0) {
|
||||
auto meta = dts.symbol_metadata_map.at(func.name());
|
||||
auto& meta = dts.symbol_metadata_map.at(func.name());
|
||||
if (meta.docstring) {
|
||||
inline_body.insert(inline_body.begin(),
|
||||
pretty_print::to_symbol(fmt::format("\"{}\"", meta.docstring.value())));
|
||||
inline_body.insert(inline_body.begin(), pretty_print::new_string(meta.docstring.value()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,8 +157,8 @@ std::string final_defun_out(const Function& func,
|
||||
auto top_form = pretty_print::build_list(top);
|
||||
|
||||
if (method_info.docstring) {
|
||||
inline_body.insert(inline_body.begin(), pretty_print::to_symbol(fmt::format(
|
||||
"\"{}\"", method_info.docstring.value())));
|
||||
inline_body.insert(inline_body.begin(),
|
||||
pretty_print::new_string(method_info.docstring.value()));
|
||||
}
|
||||
append_body_to_function_definition(&top_form, inline_body, var_dec, method_info.type);
|
||||
return pretty_print::to_string(top_form);
|
||||
|
||||
@@ -29843,21 +29843,43 @@
|
||||
;; mysql-nav-graph ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;; +++mysql-nav-graph:mysql-save-flag
|
||||
(defenum mysql-save-flag
|
||||
:type uint32
|
||||
:bitfield #t
|
||||
(delete 1)
|
||||
(update 2)
|
||||
(insert 3)
|
||||
)
|
||||
;; ---mysql-nav-graph:mysql-save-flag
|
||||
|
||||
;; +++mysql-nav-graph:nav-node-flag
|
||||
(defenum nav-node-flag
|
||||
"This string value is stored in their SQL database"
|
||||
:type uint32
|
||||
:bitfield #t
|
||||
(visited 0)
|
||||
(blocked 1)
|
||||
(pedestrian 2)
|
||||
(selected 3)
|
||||
(hidden 4))
|
||||
;; ---mysql-nav-graph:nav-node-flag
|
||||
|
||||
(declare-type mysql-nav-edge structure)
|
||||
(deftype mysql-nav-node (structure)
|
||||
((mysql-save-flag uint32 :offset-assert 0)
|
||||
((mysql-save-flag mysql-save-flag :offset-assert 0)
|
||||
(runtime-id uint32 :offset-assert 4)
|
||||
(temp-edge-list basic :offset-assert 8)
|
||||
(temp-edge-list (inline-array mysql-nav-edge) :offset-assert 8)
|
||||
(level-node-index int32 :offset-assert 12)
|
||||
(cam-dist float :offset-assert 16)
|
||||
(visible basic :offset-assert 20)
|
||||
(nav_node_id uint32 :offset-assert 24)
|
||||
(nav_graph_id uint32 :offset-assert 28)
|
||||
(position vector :inline :offset-assert 32)
|
||||
(level_name basic :offset-assert 48)
|
||||
(level_name symbol :offset-assert 48)
|
||||
(angle float :offset-assert 52)
|
||||
(radius float :offset-assert 56)
|
||||
(nav_node_flag uint32 :offset-assert 60)
|
||||
(nav_node_flag nav-node-flag :offset-assert 60)
|
||||
(nav_mesh_id uint32 :offset-assert 64)
|
||||
)
|
||||
:pack-me
|
||||
@@ -29865,25 +29887,70 @@
|
||||
:size-assert #x44
|
||||
:flag-assert #xb00000044
|
||||
(:methods
|
||||
(mysql-nav-node-method-9 () none 9)
|
||||
(mysql-nav-node-method-10 () none 10)
|
||||
(exec-sql!
|
||||
"Executes the respective SQL operation specified by `mysql-save-flag`, return value indicates success"
|
||||
(_type_) symbol 9)
|
||||
(temp-edge-size
|
||||
"Returns the number of [[mysql-nav-edge]] stored in the `temp-edge-list`"
|
||||
(_type_) int 10)
|
||||
)
|
||||
)
|
||||
|
||||
#|
|
||||
(deftype mysql-nav-node-array (inline-array-class)
|
||||
((length int32 :offset-assert 4)
|
||||
(allocated-length int32 :offset-assert 8)
|
||||
(data UNKNOWN :dynamic :offset-assert 16)
|
||||
)
|
||||
((data mysql-nav-node :dynamic :inline :offset-assert 16))
|
||||
:method-count-assert 9
|
||||
:size-assert #x10
|
||||
:flag-assert #x900000010
|
||||
)
|
||||
|#
|
||||
|
||||
;; +++mysql-nav-graph:nav-directionality
|
||||
(defenum nav-directionality
|
||||
:type uint32
|
||||
:bitfield #f
|
||||
(default 0)
|
||||
(directed 1)
|
||||
(bi_directional 2))
|
||||
;; ---mysql-nav-graph:nav-directionality
|
||||
|
||||
;; +++mysql-nav-graph:nav-clock-mask
|
||||
(defenum nav-clock-mask
|
||||
"This string value is stored in their SQL database"
|
||||
:type uint32
|
||||
:bitfield #t
|
||||
(phase-1 0)
|
||||
(phase-1a 1)
|
||||
(phase-2 2)
|
||||
(phase-2a 3)
|
||||
(phase-3 4)
|
||||
(phase-3a 5)
|
||||
(phase-4 6)
|
||||
(phase-4a 7))
|
||||
;; ---mysql-nav-graph:nav-clock-mask
|
||||
|
||||
;; +++mysql-nav-graph:nav-clock-type
|
||||
(defenum nav-clock-type
|
||||
"This string value is stored in their SQL database"
|
||||
:type uint32
|
||||
:bitfield #f
|
||||
(no-clock 0)
|
||||
(clock2 1)
|
||||
(clock3 2)
|
||||
(clock4 3))
|
||||
;; ---mysql-nav-graph:nav-clock-mask
|
||||
|
||||
;; +++mysql-nav-graph:nav-minimap-edge-flag
|
||||
(defenum nav-minimap-edge-flag
|
||||
"This string value is stored in their SQL database"
|
||||
:type int32
|
||||
:bitfield #t
|
||||
(pass-red 0)
|
||||
(pass-green 1)
|
||||
(pass-yellow 2)
|
||||
(pass-blue 3))
|
||||
;; ---mysql-nav-graph:nav-minimap-edge-flag
|
||||
|
||||
(deftype mysql-nav-edge (structure)
|
||||
((mysql-save-flag uint32 :offset-assert 0)
|
||||
((mysql-save-flag mysql-save-flag :offset-assert 0)
|
||||
(runtime-id uint32 :offset-assert 4)
|
||||
(runtime-node-id-1 int32 :offset-assert 8)
|
||||
(runtime-node-id-2 int32 :offset-assert 12)
|
||||
@@ -29892,39 +29959,34 @@
|
||||
(nav_graph_id uint32 :offset-assert 24)
|
||||
(nav_node_id_1 uint32 :offset-assert 28)
|
||||
(nav_node_id_2 uint32 :offset-assert 32)
|
||||
(directionality uint32 :offset-assert 36)
|
||||
(directionality nav-directionality :offset-assert 36)
|
||||
(speed_limit float :offset-assert 40)
|
||||
(density float :offset-assert 44)
|
||||
(traffic_edge_flag int32 :offset-assert 48)
|
||||
(nav_clock_mask uint32 :offset-assert 52)
|
||||
(nav_clock_type uint32 :offset-assert 56)
|
||||
(nav_clock_mask nav-clock-mask :offset-assert 52)
|
||||
(nav_clock_type nav-clock-type :offset-assert 56)
|
||||
(width float :offset-assert 60)
|
||||
(minimap_edge_flag int32 :offset-assert 64)
|
||||
(minimap_edge_flag nav-minimap-edge-flag :offset-assert 64)
|
||||
)
|
||||
:pack-me
|
||||
:method-count-assert 10
|
||||
:size-assert #x44
|
||||
:flag-assert #xa00000044
|
||||
(:methods
|
||||
(mysql-nav-edge-method-9 () none 9)
|
||||
)
|
||||
(exec-sql!
|
||||
"Executes the respective SQL operation specified by `mysql-save-flag`, return value indicates success"
|
||||
(_type_) symbol 9))
|
||||
)
|
||||
|
||||
#|
|
||||
(deftype mysql-nav-edge-array (inline-array-class)
|
||||
((length int32 :offset-assert 4)
|
||||
(allocated-length int32 :offset-assert 8)
|
||||
(data UNKNOWN :dynamic :offset-assert 16)
|
||||
)
|
||||
((data mysql-nav-edge :dynamic :inline :offset-assert 16))
|
||||
:method-count-assert 9
|
||||
:size-assert #x10
|
||||
:flag-assert #x900000010
|
||||
)
|
||||
|#
|
||||
|
||||
#|
|
||||
(deftype mysql-nav-visnode (structure)
|
||||
((mysql-save-flag uint32 :offset-assert 0)
|
||||
((mysql-save-flag mysql-save-flag :offset-assert 0)
|
||||
(runtime-node-id int32 :offset-assert 4)
|
||||
(runtime-edge-id int32 :offset-assert 8)
|
||||
(nav_visnode_id uint32 :offset-assert 12)
|
||||
@@ -29936,24 +29998,18 @@
|
||||
:size-assert #x1c
|
||||
:flag-assert #xa0000001c
|
||||
(:methods
|
||||
(mysql-nav-visnode-method-9 () none 9)
|
||||
)
|
||||
(exec-sql!
|
||||
"Executes the respective SQL operation specified by `mysql-save-flag`, return value indicates success"
|
||||
(_type_) symbol 9))
|
||||
)
|
||||
|#
|
||||
|
||||
#|
|
||||
(deftype mysql-nav-visnode-array (inline-array-class)
|
||||
((length int32 :offset-assert 4)
|
||||
(allocated-length int32 :offset-assert 8)
|
||||
(data UNKNOWN :dynamic :offset-assert 16)
|
||||
)
|
||||
((data mysql-nav-visnode :dynamic :inline :offset-assert 16))
|
||||
:method-count-assert 9
|
||||
:size-assert #x10
|
||||
:flag-assert #x900000010
|
||||
)
|
||||
|#
|
||||
|
||||
#|
|
||||
(deftype mysql-nav-graph-level-info (structure)
|
||||
((level basic :offset-assert 0)
|
||||
(level-id uint32 :offset-assert 4)
|
||||
@@ -29961,48 +30017,71 @@
|
||||
(branch-count int32 :offset-assert 12)
|
||||
(to-link-count int32 :offset-assert 16)
|
||||
)
|
||||
:allow-misaligned
|
||||
:method-count-assert 9
|
||||
:size-assert #x14
|
||||
:flag-assert #x900000014
|
||||
)
|
||||
|#
|
||||
|
||||
#|
|
||||
(deftype mysql-nav-graph (basic)
|
||||
((nav_graph_id uint32 :offset-assert 4)
|
||||
(node-array basic :offset-assert 8)
|
||||
(edge-array basic :offset-assert 12)
|
||||
(visnode-array basic :offset-assert 16)
|
||||
(node-array mysql-nav-node-array :offset-assert 8)
|
||||
(edge-array mysql-nav-edge-array :offset-assert 12)
|
||||
(visnode-array mysql-nav-visnode-array :offset-assert 16)
|
||||
(level-info-array-length int32 :offset-assert 20)
|
||||
(level-info-last-lookup int32 :offset-assert 24)
|
||||
(level-info-array UNKNOWN 32 :offset-assert 28)
|
||||
(level-info-array mysql-nav-graph-level-info 32 :inline :offset-assert 28)
|
||||
)
|
||||
:method-count-assert 21
|
||||
:size-assert #x41c
|
||||
:flag-assert #x150000041c
|
||||
(:methods
|
||||
(mysql-nav-graph-method-9 () none 9)
|
||||
(mysql-nav-graph-method-10 () none 10)
|
||||
(mysql-nav-graph-method-11 () none 11)
|
||||
(mysql-nav-graph-method-12 () none 12)
|
||||
(mysql-nav-graph-method-13 () none 13)
|
||||
(mysql-nav-graph-method-14 () none 14)
|
||||
(mysql-nav-graph-method-15 () none 15)
|
||||
(mysql-nav-graph-method-16 () none 16)
|
||||
(mysql-nav-graph-method-17 () none 17)
|
||||
(mysql-nav-graph-method-18 () none 18)
|
||||
(mysql-nav-graph-method-19 () none 19)
|
||||
(mysql-nav-graph-method-20 () none 20)
|
||||
(new (symbol type int string) _type_ 0)
|
||||
(init-from-sql!
|
||||
"Query the database and initialize the [[mysql-nav-graph]] and all it's related components"
|
||||
(_type_ string string) symbol 9)
|
||||
(exec-sql! (_type_) symbol 10)
|
||||
(indexof-nav-node
|
||||
"Iterate through the `node-array` and return the index for the first [[mysql-nav-node]] whom's `nav_node_id` matches the provided id
|
||||
returns `-1` if none is found"
|
||||
(_type_ int) int 11)
|
||||
(indexof-nav-edge
|
||||
"Iterate through the `edge-array` and return the index for the first [[mysql-nav-edge]] whom's `nav_edge_id` matches the provided id
|
||||
returns `-1` if none is found"
|
||||
(_type_ int) int 12)
|
||||
(alloc-new-node!
|
||||
"Allocates a new `[[mysql-nav-node]]`, if `node-array`'s `length` exceeds `3000` return `-1`
|
||||
otherwise, return the new size of the array"
|
||||
(_type_) int 13)
|
||||
(alloc-new-edge!
|
||||
"Allocates a new `[[mysql-nav-edge]]`, if `edge-array`'s `length` exceeds `5000` return `-1`
|
||||
otherwise, return the new size of the array"
|
||||
(_type_) int 14)
|
||||
(indexof-visnode
|
||||
"Returns the index in the `visnode-array` whom's [[mysql-nav-visnode]] has the provided `runtime-edge-id` and `runtime-node-id`
|
||||
if none exist, return `-1`"
|
||||
(_type_ int int) int 15)
|
||||
(alloc-new-visnode!
|
||||
"Potentially allocates a new `[[mysql-nav-visnode]]`:
|
||||
- if `visnode-array`'s `length` exceeds `3000` return `-1`
|
||||
- otherwise, if the node already exists, TODO
|
||||
- if the node does not already exist, create it!"
|
||||
(_type_ int int) int 16)
|
||||
(mysql-nav-graph-method-17
|
||||
(_type_) none 17)
|
||||
(lookup-level-info2
|
||||
"TODO - this was originally called `lookup-level-info` but it clashes with the function defined in `level`"
|
||||
(_type_ mysql-nav-node symbol) mysql-nav-graph-level-info 18)
|
||||
(mysql-nav-graph-method-19 (_type_) none 19)
|
||||
(mysql-nav-graph-method-20 (_type_) none 20)
|
||||
)
|
||||
)
|
||||
|#
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; nav-graph-editor ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
#|
|
||||
(deftype nav-graph-command (structure)
|
||||
((com-type uint32 :offset-assert 0)
|
||||
(id int32 :offset-assert 4)
|
||||
@@ -30013,19 +30092,13 @@
|
||||
:size-assert #x20
|
||||
:flag-assert #x900000020
|
||||
)
|
||||
|#
|
||||
|
||||
#|
|
||||
(deftype nav-graph-command-array (inline-array-class)
|
||||
((length int32 :offset-assert 4)
|
||||
(allocated-length int32 :offset-assert 8)
|
||||
(data UNKNOWN :dynamic :offset-assert 16)
|
||||
)
|
||||
((data nav-graph-command :dynamic :offset-assert 16))
|
||||
:method-count-assert 9
|
||||
:size-assert #x10
|
||||
:flag-assert #x900000010
|
||||
)
|
||||
|#
|
||||
|
||||
(deftype nav-graph-editor (process)
|
||||
((nav-graph basic :offset-assert 128)
|
||||
@@ -30108,12 +30181,12 @@
|
||||
(nav-graph-editor-method-59 () none 59)
|
||||
(nav-graph-editor-method-60 () none 60)
|
||||
(nav-graph-editor-method-61 () none 61)
|
||||
(nav-graph-editor-method-62 () none 62)
|
||||
(nav-graph-editor-method-62 (_type_ symbol symbol) none 62)
|
||||
(nav-graph-editor-method-63 () none 63)
|
||||
)
|
||||
)
|
||||
|
||||
;; (define-extern *nav-graph-editor* object)
|
||||
(define-extern *nav-graph-editor* nav-graph-editor)
|
||||
;; (define-extern nav-graph-editor-init-by-other function)
|
||||
(define-extern run-nav-graph-editor (function symbol none))
|
||||
(define-extern get-nav-graph-editor (function nav-graph-editor))
|
||||
|
||||
@@ -64,7 +64,6 @@
|
||||
"anim-test-anim-list-handler",
|
||||
"anim-test-sequence-list-handler",
|
||||
"anim-tester-get-playing-item",
|
||||
"(method 9 mysql-nav-graph)",
|
||||
"(method 58 nav-graph-editor)",
|
||||
"(method 120 enemy)",
|
||||
"start-pilot-recorder",
|
||||
@@ -261,7 +260,8 @@
|
||||
"(method 42 nav-mesh)": [1, 2, 3, 7],
|
||||
"point-poly-distance-min": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
|
||||
"(method 34 nav-mesh)": [1, 2, 3, 7],
|
||||
"(method 35 nav-mesh)": [2, 4]
|
||||
"(method 35 nav-mesh)": [2, 4],
|
||||
"(method 18 mysql-nav-graph)": [0, 1, 3, 4, 5, 9]
|
||||
},
|
||||
|
||||
// Sometimes the game might use format strings that are fetched dynamically,
|
||||
|
||||
@@ -2095,6 +2095,37 @@
|
||||
"debug-menu-func-decode": [
|
||||
[18, "a0", "symbol"]
|
||||
],
|
||||
"(method 13 mysql-nav-graph)": [[[15, 37], "gp", "mysql-nav-node"]],
|
||||
"(method 14 mysql-nav-graph)": [[[16, 31], "v1", "mysql-nav-edge"]],
|
||||
"(method 15 mysql-nav-graph)": [[[6, 11], "a3", "mysql-nav-visnode"]],
|
||||
"(method 16 mysql-nav-graph)": [
|
||||
[[39, 54], "v1", "mysql-nav-visnode"],
|
||||
[29, "a1", "mysql-nav-visnode"],
|
||||
[24, "a1", "mysql-nav-visnode"]
|
||||
],
|
||||
"(method 11 mysql-nav-graph)": [[7, "a2", "mysql-nav-node"]],
|
||||
"(method 12 mysql-nav-graph)": [[7, "a2", "mysql-nav-edge"]],
|
||||
"(method 19 mysql-nav-graph)": [
|
||||
[[32, 41], "s4", "mysql-nav-node"],
|
||||
[[42, 62], "a0", "mysql-nav-edge"]
|
||||
],
|
||||
"(method 10 mysql-nav-graph)": [
|
||||
[[12, 17], "a0", "mysql-nav-node"],
|
||||
[[43, 62], "a0", "mysql-nav-edge"],
|
||||
[[83, 102], "a0", "mysql-nav-visnode"]
|
||||
],
|
||||
"(method 10 mysql-nav-node)": [[4, "v1", "mysql-nav-edge"]],
|
||||
"(method 9 mysql-nav-graph)": [
|
||||
[[96, 261], "s0", "mysql-nav-node"],
|
||||
[[360, 690], "s1", "mysql-nav-edge"],
|
||||
[[781, 810], "s1", "mysql-nav-visnode"]
|
||||
],
|
||||
"(method 17 mysql-nav-graph)": [
|
||||
[7, "a1", "mysql-nav-node"],
|
||||
[22, "a1", "mysql-nav-edge"],
|
||||
[[39, 59], "a1", "mysql-nav-edge"],
|
||||
[[48, 58], "a2", "mysql-nav-node"]
|
||||
],
|
||||
// placeholder
|
||||
"placeholder-do-not-add-below": []
|
||||
}
|
||||
|
||||
@@ -963,5 +963,37 @@
|
||||
"t3-2": ["shader", "adgif-shader"],
|
||||
"t4-1": "dist-past-end"
|
||||
}
|
||||
},
|
||||
"(method 15 mysql-nav-graph)": {
|
||||
"args": ["obj", "edge-id", "node-id"]
|
||||
},
|
||||
"(method 16 mysql-nav-graph)": {
|
||||
"args": ["obj", "edge-id", "node-id"]
|
||||
},
|
||||
"(method 11 mysql-nav-graph)": {
|
||||
"args": ["obj", "node-id"]
|
||||
},
|
||||
"(method 12 mysql-nav-graph)": {
|
||||
"args": ["obj", "edge-id"]
|
||||
},
|
||||
"(method 19 mysql-nav-graph)": {
|
||||
"vars": {
|
||||
"s4-0": ["s4-0", "mysql-nav-node"],
|
||||
"a0-10": ["a0-10", "mysql-nav-edge"]
|
||||
}
|
||||
},
|
||||
"(method 10 mysql-nav-graph)": {
|
||||
"vars": {
|
||||
"a0-3": ["a0-3", "mysql-nav-node"],
|
||||
"a0-7": ["a0-7", "mysql-nav-edge"],
|
||||
"a0-13": ["a0-13", "mysql-nav-visnode"]
|
||||
}
|
||||
},
|
||||
"(method 9 mysql-nav-graph)": {
|
||||
"vars": {
|
||||
"s0-1": ["nav-node", "mysql-nav-node"],
|
||||
"s1-2": ["nav-edge", "mysql-nav-edge"],
|
||||
"s1-4": ["nav-visnode", "mysql-nav-visnode"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -866,7 +866,6 @@
|
||||
(= (-> *texture-pool* texture-enable-user-menu) arg0)
|
||||
)
|
||||
|
||||
|
||||
(defun dm-strip-lines-toggle-pick-func ((arg0 int) (arg1 debug-menu-msg))
|
||||
(if (= arg1 (debug-menu-msg press))
|
||||
(set! *display-strip-lines* (logxor *display-strip-lines* (the-as uint (/ arg0 8))))
|
||||
@@ -2662,8 +2661,8 @@
|
||||
)
|
||||
)
|
||||
|
||||
;; WARN: Return type mismatch pair vs debug-menu-node.
|
||||
(defun debug-menu-make-task-sub-menu ((arg0 symbol))
|
||||
"TODO - need to know more about game-info"
|
||||
(local-vars
|
||||
(sv-16 (function symbol type object object pair))
|
||||
(sv-32 symbol)
|
||||
@@ -2678,7 +2677,6 @@
|
||||
(sv-176 type)
|
||||
(sv-192 int)
|
||||
)
|
||||
"TODO - need to know more about game-info"
|
||||
(let ((gp-0 '()))
|
||||
(let ((s4-0 (-> *game-info* sub-task-list)))
|
||||
(countdown (s3-0 (-> s4-0 length))
|
||||
@@ -2753,7 +2751,7 @@
|
||||
)
|
||||
(set! sv-16 arg0)
|
||||
(let ((a1-2 (debug-menu-make-task-sub-menu (the-as symbol a0-3))))
|
||||
(s2-0 s1-0 (s0-0 sv-16 (the-as pair a1-2)))
|
||||
(s2-0 s1-0 (s0-0 sv-16 a1-2))
|
||||
)
|
||||
)
|
||||
(set! s3-0 (cdr s3-0))
|
||||
@@ -4126,76 +4124,54 @@
|
||||
"Load"
|
||||
(function "Hover Drillmid" #f (lambda ()
|
||||
(let ((a0-0 (get-nav-graph-editor)))
|
||||
(when a0-0
|
||||
(let ((t9-1 (method-of-object a0-0 nav-graph-editor-method-62)))
|
||||
'hover
|
||||
'drillmid
|
||||
(t9-1)
|
||||
(if a0-0
|
||||
(nav-graph-editor-method-62 a0-0 'hover 'drillmid)
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
)
|
||||
(function "Hover Forresca" #f (lambda ()
|
||||
(let ((a0-0 (get-nav-graph-editor)))
|
||||
(when a0-0
|
||||
(let ((t9-1 (method-of-object a0-0 nav-graph-editor-method-62)))
|
||||
'hover
|
||||
'forresca
|
||||
(t9-1)
|
||||
(if a0-0
|
||||
(nav-graph-editor-method-62 a0-0 'hover 'forresca)
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
)
|
||||
(function "Hover Forest" #f (lambda ()
|
||||
(let ((a0-0 (get-nav-graph-editor)))
|
||||
(when a0-0
|
||||
(let ((t9-1 (method-of-object a0-0 nav-graph-editor-method-62)))
|
||||
'hover
|
||||
'forest
|
||||
(t9-1)
|
||||
(if a0-0
|
||||
(nav-graph-editor-method-62 a0-0 'hover 'forest)
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
)
|
||||
(function "Hover Under" #f (lambda ()
|
||||
(let ((a0-0 (get-nav-graph-editor)))
|
||||
(when a0-0
|
||||
(let ((t9-1 (method-of-object a0-0 nav-graph-editor-method-62)))
|
||||
'hover
|
||||
'under
|
||||
(t9-1)
|
||||
(if a0-0
|
||||
(nav-graph-editor-method-62 a0-0 'hover 'under)
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
)
|
||||
(function "Traffic" #f (lambda ()
|
||||
(let ((a0-0 (get-nav-graph-editor)))
|
||||
(when a0-0
|
||||
(let ((t9-1 (method-of-object a0-0 nav-graph-editor-method-62)))
|
||||
'traffic
|
||||
(t9-1)
|
||||
(if a0-0
|
||||
(nav-graph-editor-method-62 a0-0 'traffic #f)
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
)
|
||||
(function "Minimap" #f (lambda ()
|
||||
(let ((a0-0 (get-nav-graph-editor)))
|
||||
(when a0-0
|
||||
(let ((t9-1 (method-of-object a0-0 nav-graph-editor-method-62)))
|
||||
'minimap
|
||||
(t9-1)
|
||||
(if a0-0
|
||||
(nav-graph-editor-method-62 a0-0 'minimap #f)
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -94,7 +94,7 @@
|
||||
(nav-graph-editor-method-59 () none 59)
|
||||
(nav-graph-editor-method-60 () none 60)
|
||||
(nav-graph-editor-method-61 () none 61)
|
||||
(nav-graph-editor-method-62 () none 62)
|
||||
(nav-graph-editor-method-62 (_type_ symbol symbol) none 62)
|
||||
(nav-graph-editor-method-63 () none 63)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -9,6 +9,8 @@ import shutil
|
||||
## update reference like this
|
||||
## python3 ../scripts/update_decomp_reference.py ./failures ../test/decompiler/reference
|
||||
|
||||
## TODO - this has a bug and isn't properly game specific
|
||||
|
||||
def get_goal_files(root_dir):
|
||||
return [f for file in os.walk(root_dir) for f in glob.glob(os.path.join(file[0], '*.gc'))]
|
||||
|
||||
|
||||
+2
-2
@@ -938,8 +938,8 @@
|
||||
;; definition (debug) for function add-debug-circle
|
||||
;; INFO: Used lq/sq
|
||||
(defun-debug add-debug-circle ((arg0 symbol) (arg1 bucket-id) (arg2 vector) (arg3 float) (arg4 rgba) (arg5 matrix))
|
||||
(local-vars (sv-48 int) (sv-64 vector) (sv-80 vector))
|
||||
"note: you may pass #f for orientation"
|
||||
(local-vars (sv-48 int) (sv-64 vector) (sv-80 vector))
|
||||
(if (not arg0)
|
||||
(return #f)
|
||||
)
|
||||
@@ -1064,8 +1064,8 @@
|
||||
(arg6 rgba)
|
||||
(arg7 matrix)
|
||||
)
|
||||
(local-vars (sv-48 vector) (sv-64 vector) (sv-80 int) (sv-96 vector) (sv-112 vector))
|
||||
"note: you may pass #f for orientation"
|
||||
(local-vars (sv-48 vector) (sv-64 vector) (sv-80 int) (sv-96 vector) (sv-112 vector))
|
||||
(if (not arg0)
|
||||
(return #f)
|
||||
)
|
||||
|
||||
-4
@@ -98,7 +98,3 @@
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -1236,8 +1236,8 @@
|
||||
;; definition (debug) for function add-debug-circle
|
||||
;; INFO: Used lq/sq
|
||||
(defun-debug add-debug-circle ((enable symbol) (bucket bucket-id) (position vector) (radius float) (color rgba) (orientation matrix))
|
||||
(local-vars (i int) (sv-64 vector) (sv-80 vector))
|
||||
"note: you may pass #f for orientation"
|
||||
(local-vars (i int) (sv-64 vector) (sv-80 vector))
|
||||
(if (not enable)
|
||||
(return #f)
|
||||
)
|
||||
@@ -1390,8 +1390,8 @@
|
||||
(color rgba)
|
||||
(orientation matrix)
|
||||
)
|
||||
(local-vars (line-start vector) (line-end vector) (i int) (sv-96 vector) (sv-112 vector))
|
||||
"note: you may pass #f for orientation"
|
||||
(local-vars (line-start vector) (line-end vector) (i int) (sv-96 vector) (sv-112 vector))
|
||||
(if (not enable)
|
||||
(return #f)
|
||||
)
|
||||
|
||||
+13
-35
@@ -2782,6 +2782,7 @@
|
||||
;; definition for function debug-menu-make-task-sub-menu
|
||||
;; INFO: Used lq/sq
|
||||
(defun debug-menu-make-task-sub-menu ((arg0 symbol))
|
||||
"TODO - need to know more about game-info"
|
||||
(local-vars
|
||||
(sv-16 (function symbol type object object pair))
|
||||
(sv-32 symbol)
|
||||
@@ -2796,7 +2797,6 @@
|
||||
(sv-176 type)
|
||||
(sv-192 int)
|
||||
)
|
||||
"TODO - need to know more about game-info"
|
||||
(let ((gp-0 '()))
|
||||
(let ((s4-0 (-> *game-info* sub-task-list)))
|
||||
(countdown (s3-0 (-> s4-0 length))
|
||||
@@ -4258,76 +4258,54 @@
|
||||
"Load"
|
||||
(function "Hover Drillmid" #f (lambda ()
|
||||
(let ((a0-0 (get-nav-graph-editor)))
|
||||
(when a0-0
|
||||
(let ((t9-1 (method-of-object a0-0 nav-graph-editor-method-62)))
|
||||
'hover
|
||||
'drillmid
|
||||
(t9-1)
|
||||
(if a0-0
|
||||
(nav-graph-editor-method-62 a0-0 'hover 'drillmid)
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
)
|
||||
(function "Hover Forresca" #f (lambda ()
|
||||
(let ((a0-0 (get-nav-graph-editor)))
|
||||
(when a0-0
|
||||
(let ((t9-1 (method-of-object a0-0 nav-graph-editor-method-62)))
|
||||
'hover
|
||||
'forresca
|
||||
(t9-1)
|
||||
(if a0-0
|
||||
(nav-graph-editor-method-62 a0-0 'hover 'forresca)
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
)
|
||||
(function "Hover Forest" #f (lambda ()
|
||||
(let ((a0-0 (get-nav-graph-editor)))
|
||||
(when a0-0
|
||||
(let ((t9-1 (method-of-object a0-0 nav-graph-editor-method-62)))
|
||||
'hover
|
||||
'forest
|
||||
(t9-1)
|
||||
(if a0-0
|
||||
(nav-graph-editor-method-62 a0-0 'hover 'forest)
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
)
|
||||
(function "Hover Under" #f (lambda ()
|
||||
(let ((a0-0 (get-nav-graph-editor)))
|
||||
(when a0-0
|
||||
(let ((t9-1 (method-of-object a0-0 nav-graph-editor-method-62)))
|
||||
'hover
|
||||
'under
|
||||
(t9-1)
|
||||
(if a0-0
|
||||
(nav-graph-editor-method-62 a0-0 'hover 'under)
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
)
|
||||
(function "Traffic" #f (lambda ()
|
||||
(let ((a0-0 (get-nav-graph-editor)))
|
||||
(when a0-0
|
||||
(let ((t9-1 (method-of-object a0-0 nav-graph-editor-method-62)))
|
||||
'traffic
|
||||
(t9-1)
|
||||
(if a0-0
|
||||
(nav-graph-editor-method-62 a0-0 'traffic #f)
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
)
|
||||
(function "Minimap" #f (lambda ()
|
||||
(let ((a0-0 (get-nav-graph-editor)))
|
||||
(when a0-0
|
||||
(let ((t9-1 (method-of-object a0-0 nav-graph-editor-method-62)))
|
||||
'minimap
|
||||
(t9-1)
|
||||
(if a0-0
|
||||
(nav-graph-editor-method-62 a0-0 'minimap #f)
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
+2
-2
@@ -1206,6 +1206,7 @@
|
||||
|
||||
;; WARN: Return type mismatch number vs float.
|
||||
(defmethod edit-get-distance editable-face ((a0-0 editable-face) (a1-0 vector))
|
||||
"Returns the distance from the camera to the [[editable]], or -1.0"
|
||||
(local-vars
|
||||
(v0-0 vector)
|
||||
(v0-1 vector)
|
||||
@@ -1275,7 +1276,6 @@
|
||||
(f0-0 float)
|
||||
(f1-0 float)
|
||||
)
|
||||
"Returns the distance from the camera to the [[editable]], or -1.0"
|
||||
(when (begin
|
||||
(set! gp-0 (new 'stack-no-clear 'vector))
|
||||
(set! a0-1 a0-0)
|
||||
@@ -1944,6 +1944,7 @@
|
||||
;; ERROR: failed type prop at 64: add failed: structure <integer 16>
|
||||
|
||||
(defmethod edit-get-distance editable-plane ((a0-0 editable-plane) (a1-0 vector))
|
||||
"Returns the distance from the camera to the [[editable]], or -1.0"
|
||||
(local-vars
|
||||
(v0-0 vector)
|
||||
(v0-1 vector)
|
||||
@@ -2019,7 +2020,6 @@
|
||||
(f0-0 float)
|
||||
(f1-0 float)
|
||||
)
|
||||
"Returns the distance from the camera to the [[editable]], or -1.0"
|
||||
(when (begin
|
||||
(set! gp-0 (new 'stack-no-clear 'vector))
|
||||
(set! a0-1 a0-0)
|
||||
|
||||
+1309
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -94,8 +94,8 @@
|
||||
|
||||
;; definition for function convert-korean-text
|
||||
(defun convert-korean-text ((arg0 game-text))
|
||||
(local-vars (v1-21 int))
|
||||
"Converts the provided [[game-text]] into korean. Returns a [[string]]"
|
||||
(local-vars (v1-21 int))
|
||||
(let ((gp-0 (&-> arg0 text)))
|
||||
*expanded-text-line0*
|
||||
(let ((s4-0 0))
|
||||
@@ -431,6 +431,7 @@
|
||||
;; WARN: Stack slot offset 20 signed mismatch
|
||||
;; WARN: Stack slot offset 56 signed mismatch
|
||||
(defun print-game-text ((arg0 string) (arg1 font-context) (arg2 symbol) (arg3 int) (arg4 int))
|
||||
"Print text."
|
||||
(local-vars
|
||||
(sv-16 float)
|
||||
(sv-20 float)
|
||||
@@ -453,7 +454,6 @@
|
||||
(sv-112 int)
|
||||
(sv-120 int)
|
||||
)
|
||||
"Print text."
|
||||
(cond
|
||||
((< 0.1 (-> arg1 scale))
|
||||
(set! sv-16 (-> arg1 origin x))
|
||||
|
||||
-4
@@ -132,7 +132,3 @@
|
||||
)
|
||||
obj
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -124,6 +124,10 @@
|
||||
// texture
|
||||
"(method 9 texture-page-dir)", // asm
|
||||
|
||||
// mysql-nav-graph
|
||||
"(method 18 mysql-nav-graph)", // asm / dead-code
|
||||
"(method 10 mysql-nav-graph)",
|
||||
|
||||
"i-hopefully-will-never-exist-dont-add-anything-after-me-please"
|
||||
],
|
||||
|
||||
|
||||
Reference in New Issue
Block a user