mirror of
https://github.com/open-goal/jak-project
synced 2026-08-02 00:34:13 -04:00
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:
@@ -84,152 +84,128 @@
|
||||
(declare-file (debug))
|
||||
|
||||
(deftype mysql-nav-node (structure)
|
||||
((mysql-save-flag mysql-save-flag :offset-assert 0)
|
||||
(runtime-id uint32 :offset-assert 4)
|
||||
(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 symbol :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 symbol :offset-assert 48)
|
||||
(angle float :offset-assert 52)
|
||||
(radius float :offset-assert 56)
|
||||
(nav_node_flag nav-node-flag :offset-assert 60)
|
||||
(nav_mesh_id uint32 :offset-assert 64)
|
||||
((mysql-save-flag mysql-save-flag)
|
||||
(runtime-id uint32)
|
||||
(temp-edge-list (inline-array mysql-nav-edge))
|
||||
(level-node-index int32)
|
||||
(cam-dist float)
|
||||
(visible symbol)
|
||||
(nav_node_id uint32)
|
||||
(nav_graph_id uint32)
|
||||
(position vector :inline)
|
||||
(level_name symbol)
|
||||
(angle float)
|
||||
(radius float)
|
||||
(nav_node_flag nav-node-flag)
|
||||
(nav_mesh_id uint32)
|
||||
)
|
||||
:pack-me
|
||||
:method-count-assert 11
|
||||
:size-assert #x44
|
||||
:flag-assert #xb00000044
|
||||
(:methods
|
||||
(exec-sql! (_type_) symbol 9)
|
||||
(temp-edge-size (_type_) int 10)
|
||||
(exec-sql! (_type_) symbol)
|
||||
(temp-edge-size (_type_) int)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype mysql-nav-node-array (inline-array-class)
|
||||
((data mysql-nav-node :inline :dynamic :offset-assert 16)
|
||||
((data mysql-nav-node :inline :dynamic)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x10
|
||||
:flag-assert #x900000010
|
||||
)
|
||||
|
||||
|
||||
(set! (-> mysql-nav-node-array heap-base) (the-as uint 80))
|
||||
|
||||
(deftype mysql-nav-edge (structure)
|
||||
((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)
|
||||
(temp-next-edge mysql-nav-edge :offset-assert 16)
|
||||
(nav_edge_id uint32 :offset-assert 20)
|
||||
(nav_graph_id uint32 :offset-assert 24)
|
||||
(nav_node_id_1 uint32 :offset-assert 28)
|
||||
(nav_node_id_2 uint32 :offset-assert 32)
|
||||
(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 nav-clock-mask :offset-assert 52)
|
||||
(nav_clock_type nav-clock-type :offset-assert 56)
|
||||
(width float :offset-assert 60)
|
||||
(minimap_edge_flag nav-minimap-edge-flag :offset-assert 64)
|
||||
((mysql-save-flag mysql-save-flag)
|
||||
(runtime-id uint32)
|
||||
(runtime-node-id-1 int32)
|
||||
(runtime-node-id-2 int32)
|
||||
(temp-next-edge mysql-nav-edge)
|
||||
(nav_edge_id uint32)
|
||||
(nav_graph_id uint32)
|
||||
(nav_node_id_1 uint32)
|
||||
(nav_node_id_2 uint32)
|
||||
(directionality nav-directionality)
|
||||
(speed_limit float)
|
||||
(density float)
|
||||
(traffic_edge_flag int32)
|
||||
(nav_clock_mask nav-clock-mask)
|
||||
(nav_clock_type nav-clock-type)
|
||||
(width float)
|
||||
(minimap_edge_flag nav-minimap-edge-flag)
|
||||
)
|
||||
:allow-misaligned
|
||||
:method-count-assert 10
|
||||
:size-assert #x44
|
||||
:flag-assert #xa00000044
|
||||
(:methods
|
||||
(exec-sql! (_type_) symbol 9)
|
||||
(exec-sql! (_type_) symbol)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype mysql-nav-edge-array (inline-array-class)
|
||||
((data mysql-nav-edge :inline :dynamic :offset-assert 16)
|
||||
((data mysql-nav-edge :inline :dynamic)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x10
|
||||
:flag-assert #x900000010
|
||||
)
|
||||
|
||||
|
||||
(set! (-> mysql-nav-edge-array heap-base) (the-as uint 80))
|
||||
|
||||
(deftype mysql-nav-visnode (structure)
|
||||
((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)
|
||||
(nav_graph_id uint32 :offset-assert 16)
|
||||
(nav_node_id uint32 :offset-assert 20)
|
||||
(nav_edge_id uint32 :offset-assert 24)
|
||||
((mysql-save-flag mysql-save-flag)
|
||||
(runtime-node-id int32)
|
||||
(runtime-edge-id int32)
|
||||
(nav_visnode_id uint32)
|
||||
(nav_graph_id uint32)
|
||||
(nav_node_id uint32)
|
||||
(nav_edge_id uint32)
|
||||
)
|
||||
:method-count-assert 10
|
||||
:size-assert #x1c
|
||||
:flag-assert #xa0000001c
|
||||
(:methods
|
||||
(exec-sql! (_type_) symbol 9)
|
||||
(exec-sql! (_type_) symbol)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype mysql-nav-visnode-array (inline-array-class)
|
||||
((data mysql-nav-visnode :inline :dynamic :offset-assert 16)
|
||||
((data mysql-nav-visnode :inline :dynamic)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x10
|
||||
:flag-assert #x900000010
|
||||
)
|
||||
|
||||
|
||||
(set! (-> mysql-nav-visnode-array heap-base) (the-as uint 32))
|
||||
|
||||
(deftype mysql-nav-graph-level-info (structure)
|
||||
((level symbol :offset-assert 0)
|
||||
(level-id uint32 :offset-assert 4)
|
||||
(node-count int32 :offset-assert 8)
|
||||
(branch-count int32 :offset-assert 12)
|
||||
(to-link-count int32 :offset-assert 16)
|
||||
((level symbol)
|
||||
(level-id uint32)
|
||||
(node-count int32)
|
||||
(branch-count int32)
|
||||
(to-link-count int32)
|
||||
)
|
||||
: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 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 mysql-nav-graph-level-info 32 :inline :offset-assert 28)
|
||||
((nav_graph_id uint32)
|
||||
(node-array mysql-nav-node-array)
|
||||
(edge-array mysql-nav-edge-array)
|
||||
(visnode-array mysql-nav-visnode-array)
|
||||
(level-info-array-length int32)
|
||||
(level-info-last-lookup int32)
|
||||
(level-info-array mysql-nav-graph-level-info 32 :inline)
|
||||
)
|
||||
:method-count-assert 21
|
||||
:size-assert #x41c
|
||||
:flag-assert #x150000041c
|
||||
(:methods
|
||||
(new (symbol type string) _type_ 0)
|
||||
(init-from-sql! (_type_ string string) symbol 9)
|
||||
(exec-sql! (_type_) symbol 10)
|
||||
(indexof-nav-node (_type_ int) int 11)
|
||||
(indexof-nav-edge (_type_ int) int 12)
|
||||
(alloc-new-node! (_type_) int 13)
|
||||
(alloc-new-edge! (_type_) int 14)
|
||||
(indexof-visnode (_type_ int int) int 15)
|
||||
(alloc-new-visnode! (_type_ int int) int 16)
|
||||
(mysql-nav-graph-method-17 (_type_) none 17)
|
||||
(lookup-level-info2 (_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)
|
||||
(new (symbol type string) _type_)
|
||||
(init-from-sql! (_type_ string string) symbol)
|
||||
(exec-sql! (_type_) symbol)
|
||||
(indexof-nav-node (_type_ int) int)
|
||||
(indexof-nav-edge (_type_ int) int)
|
||||
(alloc-new-node! (_type_) int)
|
||||
(alloc-new-edge! (_type_) int)
|
||||
(indexof-visnode (_type_ int int) int)
|
||||
(alloc-new-visnode! (_type_ int int) int)
|
||||
(mysql-nav-graph-method-17 (_type_) none)
|
||||
(lookup-level-info2 (_type_ mysql-nav-node symbol) mysql-nav-graph-level-info)
|
||||
(mysql-nav-graph-method-19 (_type_) none)
|
||||
(mysql-nav-graph-method-20 (_type_) none)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -260,7 +236,7 @@
|
||||
)
|
||||
)
|
||||
|
||||
(defmethod alloc-new-node! mysql-nav-graph ((this mysql-nav-graph))
|
||||
(defmethod alloc-new-node! ((this mysql-nav-graph))
|
||||
"Allocates a new `[[mysql-nav-node]]`, if `node-array`'s `length` exceeds `3000` return `-1`
|
||||
otherwise, return the new size of the array"
|
||||
(cond
|
||||
@@ -284,7 +260,7 @@ otherwise, return the new size of the array"
|
||||
)
|
||||
)
|
||||
|
||||
(defmethod alloc-new-edge! mysql-nav-graph ((this mysql-nav-graph))
|
||||
(defmethod alloc-new-edge! ((this mysql-nav-graph))
|
||||
"Allocates a new `[[mysql-nav-edge]]`, if `edge-array`'s `length` exceeds `5000` return `-1`
|
||||
otherwise, return the new size of the array"
|
||||
(cond
|
||||
@@ -308,7 +284,7 @@ otherwise, return the new size of the array"
|
||||
)
|
||||
)
|
||||
|
||||
(defmethod indexof-visnode mysql-nav-graph ((this mysql-nav-graph) (edge-id int) (node-id int))
|
||||
(defmethod indexof-visnode ((this mysql-nav-graph) (edge-id int) (node-id int))
|
||||
"Returns the index in the `visnode-array` whom's [[mysql-nav-visnode]] has the provided `runtime-edge-id` and `runtime-node-id`
|
||||
if none exist, return `-1`"
|
||||
(dotimes (v1-0 (-> this visnode-array length))
|
||||
@@ -321,7 +297,7 @@ if none exist, return `-1`"
|
||||
-1
|
||||
)
|
||||
|
||||
(defmethod alloc-new-visnode! mysql-nav-graph ((this mysql-nav-graph) (edge-id int) (node-id int))
|
||||
(defmethod alloc-new-visnode! ((this mysql-nav-graph) (edge-id int) (node-id int))
|
||||
"Potentially allocates a new `[[mysql-nav-visnode]]`:
|
||||
- if `visnode-array`'s `length` exceeds `3000` return `-1`
|
||||
- otherwise, if the node already exists, TODO
|
||||
@@ -356,7 +332,7 @@ if none exist, return `-1`"
|
||||
)
|
||||
)
|
||||
|
||||
(defmethod exec-sql! mysql-nav-node ((this mysql-nav-node))
|
||||
(defmethod exec-sql! ((this mysql-nav-node))
|
||||
"Executes the respective SQL operation specified by `mysql-save-flag`, return value indicates success"
|
||||
(if (and (logtest? (-> this mysql-save-flag) (mysql-save-flag insert))
|
||||
(logtest? (-> this mysql-save-flag) (mysql-save-flag delete))
|
||||
@@ -461,7 +437,7 @@ if none exist, return `-1`"
|
||||
#t
|
||||
)
|
||||
|
||||
(defmethod exec-sql! mysql-nav-edge ((this mysql-nav-edge))
|
||||
(defmethod exec-sql! ((this mysql-nav-edge))
|
||||
"Executes the respective SQL operation specified by `mysql-save-flag`, return value indicates success"
|
||||
(if (and (logtest? (-> this mysql-save-flag) (mysql-save-flag insert))
|
||||
(logtest? (-> this mysql-save-flag) (mysql-save-flag delete))
|
||||
@@ -665,7 +641,7 @@ if none exist, return `-1`"
|
||||
#t
|
||||
)
|
||||
|
||||
(defmethod exec-sql! mysql-nav-visnode ((this mysql-nav-visnode))
|
||||
(defmethod exec-sql! ((this mysql-nav-visnode))
|
||||
"Executes the respective SQL operation specified by `mysql-save-flag`, return value indicates success"
|
||||
(if (and (logtest? (-> this mysql-save-flag) (mysql-save-flag insert))
|
||||
(logtest? (-> this mysql-save-flag) (mysql-save-flag delete))
|
||||
@@ -719,7 +695,7 @@ if none exist, return `-1`"
|
||||
#t
|
||||
)
|
||||
|
||||
(defmethod indexof-nav-node mysql-nav-graph ((this mysql-nav-graph) (node-id int))
|
||||
(defmethod indexof-nav-node ((this mysql-nav-graph) (node-id int))
|
||||
"Iterate through the `node-array` and return the index for the first [[mysql-nav-node]] whom's `nav_node_id` matches the provided id
|
||||
returns `-1` if none is found"
|
||||
(dotimes (v1-0 (-> this node-array length))
|
||||
@@ -730,7 +706,7 @@ returns `-1` if none is found"
|
||||
-1
|
||||
)
|
||||
|
||||
(defmethod indexof-nav-edge mysql-nav-graph ((this mysql-nav-graph) (edge-id int))
|
||||
(defmethod indexof-nav-edge ((this mysql-nav-graph) (edge-id int))
|
||||
"Iterate through the `edge-array` and return the index for the first [[mysql-nav-edge]] whom's `nav_edge_id` matches the provided id
|
||||
returns `-1` if none is found"
|
||||
(dotimes (v1-0 (-> this edge-array length))
|
||||
@@ -748,7 +724,7 @@ returns `-1` if none is found"
|
||||
;; WARN: new jak 2 until loop case, check carefully
|
||||
;; WARN: new jak 2 until loop case, check carefully
|
||||
;; WARN: new jak 2 until loop case, check carefully
|
||||
(defmethod init-from-sql! mysql-nav-graph ((this mysql-nav-graph) (arg0 string) (arg1 string))
|
||||
(defmethod init-from-sql! ((this mysql-nav-graph) (arg0 string) (arg1 string))
|
||||
"Query the database and initialize the [[mysql-nav-graph]] and all it's related components"
|
||||
(local-vars (sv-16 string) (sv-32 int) (sv-48 int) (sv-64 int))
|
||||
(set! (-> this node-array length) 0)
|
||||
@@ -1080,7 +1056,7 @@ returns `-1` if none is found"
|
||||
#t
|
||||
)
|
||||
|
||||
(defmethod temp-edge-size mysql-nav-node ((this mysql-nav-node))
|
||||
(defmethod temp-edge-size ((this mysql-nav-node))
|
||||
"Returns the number of [[mysql-nav-edge]] stored in the `temp-edge-list`"
|
||||
(let ((v0-0 0))
|
||||
(let ((v1-0 (the-as object (-> this temp-edge-list))))
|
||||
@@ -1093,7 +1069,7 @@ returns `-1` if none is found"
|
||||
)
|
||||
)
|
||||
|
||||
(defmethod mysql-nav-graph-method-17 mysql-nav-graph ((this mysql-nav-graph))
|
||||
(defmethod mysql-nav-graph-method-17 ((this mysql-nav-graph))
|
||||
(dotimes (v1-0 (-> this node-array length))
|
||||
(set! (-> (the-as mysql-nav-node (-> this node-array data v1-0)) temp-edge-list)
|
||||
(the-as (inline-array mysql-nav-edge) #f)
|
||||
@@ -1125,7 +1101,7 @@ returns `-1` if none is found"
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod lookup-level-info2 mysql-nav-graph ((this mysql-nav-graph) (arg0 mysql-nav-node) (arg1 symbol))
|
||||
(defmethod lookup-level-info2 ((this mysql-nav-graph) (arg0 mysql-nav-node) (arg1 symbol))
|
||||
"TODO - this was originally called `lookup-level-info` but it clashes with the function defined in `level`"
|
||||
(let ((s5-0 (the-as mysql-nav-graph-level-info #f)))
|
||||
(b! (>= (-> this level-info-last-lookup) (-> this level-info-array-length)) cfg-3 :delay #f)
|
||||
@@ -1193,7 +1169,7 @@ returns `-1` if none is found"
|
||||
)
|
||||
|
||||
|
||||
(defmethod mysql-nav-graph-method-20 mysql-nav-graph ((this mysql-nav-graph))
|
||||
(defmethod mysql-nav-graph-method-20 ((this mysql-nav-graph))
|
||||
(mysql-nav-graph-method-17 this)
|
||||
(mysql-nav-graph-method-19 this)
|
||||
0
|
||||
|
||||
@@ -17,113 +17,105 @@
|
||||
(declare-file (debug))
|
||||
|
||||
(deftype nav-graph-command (structure)
|
||||
((com-type uint32 :offset-assert 0)
|
||||
(id int32 :offset-assert 4)
|
||||
(index int32 :offset-assert 8)
|
||||
(move-vec vector :inline :offset-assert 16)
|
||||
((com-type uint32)
|
||||
(id int32)
|
||||
(index int32)
|
||||
(move-vec vector :inline)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x20
|
||||
:flag-assert #x900000020
|
||||
)
|
||||
|
||||
|
||||
(deftype nav-graph-command-array (inline-array-class)
|
||||
((data nav-graph-command :inline :dynamic :offset-assert 16)
|
||||
((data nav-graph-command :inline :dynamic)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x10
|
||||
:flag-assert #x900000010
|
||||
)
|
||||
|
||||
|
||||
(set! (-> nav-graph-command-array heap-base) (the-as uint 32))
|
||||
|
||||
(deftype nav-graph-editor (process)
|
||||
((self nav-graph-editor :override)
|
||||
(nav-graph mysql-nav-graph :offset-assert 128)
|
||||
(mode symbol :offset-assert 132)
|
||||
(command-id int32 :offset-assert 136)
|
||||
(max-command int32 :offset-assert 140)
|
||||
(selected-index int32 :offset-assert 144)
|
||||
(selected-dist float :offset-assert 148)
|
||||
(selected-node-edge? symbol :offset-assert 152)
|
||||
(closest-node int32 :offset-assert 156)
|
||||
(dist-closest-node float :offset-assert 160)
|
||||
(closest-edge int32 :offset-assert 164)
|
||||
(dist-closest-edge float :offset-assert 168)
|
||||
(mouse-pos vector :inline :offset-assert 176)
|
||||
(mouse-hit vector :inline :offset-assert 192)
|
||||
(mouse-hit-pick vector :inline :offset-assert 208)
|
||||
(mouse-normal vector :inline :offset-assert 224)
|
||||
(mouse-spos-hold vector :inline :offset-assert 240)
|
||||
(edge-src int32 :offset-assert 256)
|
||||
(edge-dst int32 :offset-assert 260)
|
||||
(edge-visibility int32 :offset-assert 264)
|
||||
(vehicle-edit-mode symbol :offset-assert 268)
|
||||
(hover-edit-mode symbol :offset-assert 272)
|
||||
(clipping-dist float :offset-assert 276)
|
||||
(plane-height float :offset-assert 280)
|
||||
(plane-height-hold float :offset-assert 284)
|
||||
(default-node mysql-nav-node :inline :offset-assert 288)
|
||||
(default-edge mysql-nav-edge :inline :offset-assert 356)
|
||||
(command-array nav-graph-command-array :offset-assert 424)
|
||||
((self nav-graph-editor :override)
|
||||
(nav-graph mysql-nav-graph)
|
||||
(mode symbol)
|
||||
(command-id int32)
|
||||
(max-command int32)
|
||||
(selected-index int32)
|
||||
(selected-dist float)
|
||||
(selected-node-edge? symbol)
|
||||
(closest-node int32)
|
||||
(dist-closest-node float)
|
||||
(closest-edge int32)
|
||||
(dist-closest-edge float)
|
||||
(mouse-pos vector :inline)
|
||||
(mouse-hit vector :inline)
|
||||
(mouse-hit-pick vector :inline)
|
||||
(mouse-normal vector :inline)
|
||||
(mouse-spos-hold vector :inline)
|
||||
(edge-src int32)
|
||||
(edge-dst int32)
|
||||
(edge-visibility int32)
|
||||
(vehicle-edit-mode symbol)
|
||||
(hover-edit-mode symbol)
|
||||
(clipping-dist float)
|
||||
(plane-height float)
|
||||
(plane-height-hold float)
|
||||
(default-node mysql-nav-node :inline)
|
||||
(default-edge mysql-nav-edge :inline)
|
||||
(command-array nav-graph-command-array)
|
||||
)
|
||||
:heap-base #x130
|
||||
:method-count-assert 64
|
||||
:size-assert #x1ac
|
||||
:flag-assert #x40013001ac
|
||||
(:state-methods
|
||||
move-node
|
||||
move-plane
|
||||
create
|
||||
edit-edge
|
||||
create-edge
|
||||
adjust-plane
|
||||
adjust-it
|
||||
adjust-minimap
|
||||
adjust-node-angle
|
||||
adjust-node-radius
|
||||
adjust-edge-visibility
|
||||
adjust-edge-width
|
||||
adjust-edge-density
|
||||
draw-closest-minimap
|
||||
)
|
||||
(:methods
|
||||
(move-node () _type_ :state 14)
|
||||
(move-plane () _type_ :state 15)
|
||||
(create () _type_ :state 16)
|
||||
(edit-edge () _type_ :state 17)
|
||||
(create-edge () _type_ :state 18)
|
||||
(adjust-plane () _type_ :state 19)
|
||||
(adjust-it () _type_ :state 20)
|
||||
(adjust-minimap () _type_ :state 21)
|
||||
(adjust-node-angle () _type_ :state 22)
|
||||
(adjust-node-radius () _type_ :state 23)
|
||||
(adjust-edge-visibility () _type_ :state 24)
|
||||
(adjust-edge-width () _type_ :state 25)
|
||||
(adjust-edge-density () _type_ :state 26)
|
||||
(draw-closest-minimap () _type_ :state 27)
|
||||
(nav-graph-editor-method-28 (_type_) none 28)
|
||||
(nav-graph-editor-method-29 (_type_ string string string) none 29)
|
||||
(nav-graph-editor-method-30 (_type_ int) symbol 30)
|
||||
(nav-graph-editor-method-31 (_type_ int) symbol 31)
|
||||
(nav-graph-editor-method-32 (_type_ symbol int) none 32)
|
||||
(nav-graph-editor-method-33 (_type_ int) none 33)
|
||||
(nav-graph-editor-method-34 (_type_) object 34)
|
||||
(nav-graph-editor-method-35 (_type_) none 35)
|
||||
(nav-graph-editor-method-36 (_type_) none 36)
|
||||
(nav-graph-editor-method-37 (_type_) none 37)
|
||||
(nav-graph-editor-method-38 (_type_) none 38)
|
||||
(nav-graph-editor-method-39 (_type_) none 39)
|
||||
(nav-graph-editor-method-40 (_type_) none 40)
|
||||
(nav-graph-editor-method-41 (_type_) none 41)
|
||||
(nav-graph-editor-method-42 (_type_) symbol 42)
|
||||
(nav-graph-editor-method-43 (_type_) none 43)
|
||||
(nav-graph-editor-method-44 (_type_) symbol 44)
|
||||
(nav-graph-editor-method-45 (_type_) none 45)
|
||||
(nav-graph-editor-method-46 (_type_) pad-buttons 46)
|
||||
(nav-graph-editor-method-47 (_type_) none 47)
|
||||
(nav-graph-editor-method-48 (_type_ uint) nav-graph-command 48)
|
||||
(nav-graph-editor-method-49 (_type_) nav-graph-command 49)
|
||||
(nav-graph-editor-method-50 (_type_) none 50)
|
||||
(nav-graph-editor-method-51 (_type_) none 51)
|
||||
(nav-graph-editor-method-52 (_type_) uint 52)
|
||||
(nav-graph-editor-method-53 (_type_ int int) none 53)
|
||||
(nav-graph-editor-method-54 (_type_ int) none 54)
|
||||
(nav-graph-editor-method-55 (_type_ int) none 55)
|
||||
(nav-graph-editor-method-56 (_type_ int) none 56)
|
||||
(nav-graph-editor-method-57 (_type_ int int) int 57)
|
||||
(nav-graph-editor-method-58 (_type_) symbol 58)
|
||||
(nav-graph-editor-method-59 (_type_) pad-buttons 59)
|
||||
(nav-graph-editor-method-60 (_type_) none 60)
|
||||
(nav-graph-editor-method-61 (_type_) none 61)
|
||||
(nav-graph-editor-method-62 (_type_ symbol symbol) none 62)
|
||||
(nav-graph-editor-method-63 (_type_) none 63)
|
||||
(nav-graph-editor-method-28 (_type_) none)
|
||||
(nav-graph-editor-method-29 (_type_ string string string) none)
|
||||
(nav-graph-editor-method-30 (_type_ int) symbol)
|
||||
(nav-graph-editor-method-31 (_type_ int) symbol)
|
||||
(nav-graph-editor-method-32 (_type_ symbol int) none)
|
||||
(nav-graph-editor-method-33 (_type_ int) none)
|
||||
(nav-graph-editor-method-34 (_type_) object)
|
||||
(nav-graph-editor-method-35 (_type_) none)
|
||||
(nav-graph-editor-method-36 (_type_) none)
|
||||
(nav-graph-editor-method-37 (_type_) none)
|
||||
(nav-graph-editor-method-38 (_type_) none)
|
||||
(nav-graph-editor-method-39 (_type_) none)
|
||||
(nav-graph-editor-method-40 (_type_) none)
|
||||
(nav-graph-editor-method-41 (_type_) none)
|
||||
(nav-graph-editor-method-42 (_type_) symbol)
|
||||
(nav-graph-editor-method-43 (_type_) none)
|
||||
(nav-graph-editor-method-44 (_type_) symbol)
|
||||
(nav-graph-editor-method-45 (_type_) none)
|
||||
(nav-graph-editor-method-46 (_type_) pad-buttons)
|
||||
(nav-graph-editor-method-47 (_type_) none)
|
||||
(nav-graph-editor-method-48 (_type_ uint) nav-graph-command)
|
||||
(nav-graph-editor-method-49 (_type_) nav-graph-command)
|
||||
(nav-graph-editor-method-50 (_type_) none)
|
||||
(nav-graph-editor-method-51 (_type_) none)
|
||||
(nav-graph-editor-method-52 (_type_) uint)
|
||||
(nav-graph-editor-method-53 (_type_ int int) none)
|
||||
(nav-graph-editor-method-54 (_type_ int) none)
|
||||
(nav-graph-editor-method-55 (_type_ int) none)
|
||||
(nav-graph-editor-method-56 (_type_ int) none)
|
||||
(nav-graph-editor-method-57 (_type_ int int) int)
|
||||
(nav-graph-editor-method-58 (_type_) symbol)
|
||||
(nav-graph-editor-method-59 (_type_) pad-buttons)
|
||||
(nav-graph-editor-method-60 (_type_) none)
|
||||
(nav-graph-editor-method-61 (_type_) none)
|
||||
(nav-graph-editor-method-62 (_type_ symbol symbol) none)
|
||||
(nav-graph-editor-method-63 (_type_) none)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -131,7 +123,7 @@
|
||||
(define *nav-graph-editor* (the-as (pointer nav-graph-editor) #f))
|
||||
|
||||
;; WARN: Return type mismatch symbol vs none.
|
||||
(defmethod nav-graph-editor-method-62 nav-graph-editor ((this nav-graph-editor) (arg0 symbol) (arg1 symbol))
|
||||
(defmethod nav-graph-editor-method-62 ((this nav-graph-editor) (arg0 symbol) (arg1 symbol))
|
||||
(case arg0
|
||||
(('minimap)
|
||||
(set! (-> this vehicle-edit-mode) #t)
|
||||
@@ -150,24 +142,24 @@
|
||||
)
|
||||
|
||||
;; WARN: Return type mismatch symbol vs none.
|
||||
(defmethod nav-graph-editor-method-63 nav-graph-editor ((this nav-graph-editor))
|
||||
(defmethod nav-graph-editor-method-63 ((this nav-graph-editor))
|
||||
(set! (-> this command-array length) 0)
|
||||
(exec-sql! (-> this nav-graph))
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod deactivate nav-graph-editor ((this nav-graph-editor))
|
||||
(defmethod deactivate ((this nav-graph-editor))
|
||||
(set! *nav-graph-editor* (the-as (pointer nav-graph-editor) #f))
|
||||
((method-of-type process deactivate) this)
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod relocate nav-graph-editor ((this nav-graph-editor) (arg0 int))
|
||||
(defmethod relocate ((this nav-graph-editor) (arg0 int))
|
||||
(call-parent-method this arg0)
|
||||
)
|
||||
|
||||
;; WARN: Return type mismatch symbol vs none.
|
||||
(defmethod nav-graph-editor-method-60 nav-graph-editor ((this nav-graph-editor))
|
||||
(defmethod nav-graph-editor-method-60 ((this nav-graph-editor))
|
||||
(let ((v0-0 (not (-> this vehicle-edit-mode))))
|
||||
(set! (-> this vehicle-edit-mode) v0-0)
|
||||
(set! (-> this default-node nav_node_flag) (if v0-0
|
||||
@@ -180,14 +172,14 @@
|
||||
)
|
||||
|
||||
;; WARN: Return type mismatch symbol vs none.
|
||||
(defmethod nav-graph-editor-method-61 nav-graph-editor ((this nav-graph-editor))
|
||||
(defmethod nav-graph-editor-method-61 ((this nav-graph-editor))
|
||||
(set! (-> this hover-edit-mode) (not (-> this hover-edit-mode)))
|
||||
(none)
|
||||
)
|
||||
|
||||
;; WARN: Return type mismatch symbol vs none.
|
||||
;; WARN: Function (method 54 nav-graph-editor) has a return type of none, but the expression builder found a return statement.
|
||||
(defmethod nav-graph-editor-method-54 nav-graph-editor ((this nav-graph-editor) (arg0 int))
|
||||
(defmethod nav-graph-editor-method-54 ((this nav-graph-editor) (arg0 int))
|
||||
(when (not (-> this hover-edit-mode))
|
||||
(let ((gp-0 (-> this nav-graph node-array data arg0)))
|
||||
(dotimes (s5-0 (-> *level* length))
|
||||
@@ -233,7 +225,7 @@
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod nav-graph-editor-method-30 nav-graph-editor ((this nav-graph-editor) (arg0 int))
|
||||
(defmethod nav-graph-editor-method-30 ((this nav-graph-editor) (arg0 int))
|
||||
(let ((s3-0 (-> this nav-graph edge-array data arg0))
|
||||
(s4-0 (new 'stack-no-clear 'matrix))
|
||||
)
|
||||
@@ -330,7 +322,7 @@
|
||||
#f
|
||||
)
|
||||
|
||||
(defmethod nav-graph-editor-method-33 nav-graph-editor ((this nav-graph-editor) (arg0 int))
|
||||
(defmethod nav-graph-editor-method-33 ((this nav-graph-editor) (arg0 int))
|
||||
(let* ((gp-0 (-> this nav-graph edge-array data arg0))
|
||||
(s5-0 (-> this nav-graph node-array data (-> gp-0 runtime-node-id-1)))
|
||||
(s3-0 (-> this nav-graph node-array data (-> gp-0 runtime-node-id-2)))
|
||||
@@ -363,7 +355,7 @@
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod nav-graph-editor-method-31 nav-graph-editor ((this nav-graph-editor) (arg0 int))
|
||||
(defmethod nav-graph-editor-method-31 ((this nav-graph-editor) (arg0 int))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
@@ -431,7 +423,7 @@
|
||||
)
|
||||
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod nav-graph-editor-method-29 nav-graph-editor ((this nav-graph-editor) (arg0 string) (arg1 string) (arg2 string))
|
||||
(defmethod nav-graph-editor-method-29 ((this nav-graph-editor) (arg0 string) (arg1 string) (arg2 string))
|
||||
(format *stdcon* "~0K")
|
||||
;; og:preserve-this
|
||||
(format *stdcon* "~%~%~3L~18S~18S~18S~%~0L" "Left button" "Middle button" "Right button")
|
||||
@@ -440,7 +432,7 @@
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod nav-graph-editor-method-28 nav-graph-editor ((this nav-graph-editor))
|
||||
(defmethod nav-graph-editor-method-28 ((this nav-graph-editor))
|
||||
(local-vars (sv-144 int) (sv-160 (function _varargs_ object)))
|
||||
(rlet ((vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
@@ -608,7 +600,7 @@
|
||||
)
|
||||
)
|
||||
|
||||
(defmethod nav-graph-editor-method-34 nav-graph-editor ((this nav-graph-editor))
|
||||
(defmethod nav-graph-editor-method-34 ((this nav-graph-editor))
|
||||
(with-pp
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
@@ -910,12 +902,12 @@
|
||||
)
|
||||
)
|
||||
|
||||
(defmethod nav-graph-editor-method-41 nav-graph-editor ((this nav-graph-editor))
|
||||
(defmethod nav-graph-editor-method-41 ((this nav-graph-editor))
|
||||
(set! (-> this selected-index) -1)
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod nav-graph-editor-method-42 nav-graph-editor ((this nav-graph-editor))
|
||||
(defmethod nav-graph-editor-method-42 ((this nav-graph-editor))
|
||||
(let ((s5-0 (-> this nav-graph)))
|
||||
(dotimes (s4-0 (-> s5-0 node-array length))
|
||||
(let ((s3-0 (-> s5-0 node-array data s4-0)))
|
||||
@@ -952,7 +944,7 @@
|
||||
#f
|
||||
)
|
||||
|
||||
(defmethod nav-graph-editor-method-44 nav-graph-editor ((this nav-graph-editor))
|
||||
(defmethod nav-graph-editor-method-44 ((this nav-graph-editor))
|
||||
(set! (-> this closest-node) -1)
|
||||
(set! (-> this dist-closest-node) 0.0)
|
||||
(let ((s5-0 (-> this nav-graph)))
|
||||
@@ -976,7 +968,7 @@
|
||||
)
|
||||
|
||||
;; WARN: Return type mismatch symbol vs none.
|
||||
(defmethod nav-graph-editor-method-45 nav-graph-editor ((this nav-graph-editor))
|
||||
(defmethod nav-graph-editor-method-45 ((this nav-graph-editor))
|
||||
(set! (-> this closest-edge) -1)
|
||||
(set! (-> this dist-closest-edge) 0.0)
|
||||
(let ((s5-0 (-> this nav-graph)))
|
||||
@@ -1011,7 +1003,7 @@
|
||||
)
|
||||
|
||||
;; WARN: Return type mismatch symbol vs none.
|
||||
(defmethod nav-graph-editor-method-43 nav-graph-editor ((this nav-graph-editor))
|
||||
(defmethod nav-graph-editor-method-43 ((this nav-graph-editor))
|
||||
(local-vars (sv-128 vector) (sv-144 vector))
|
||||
(rlet ((vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
@@ -1086,7 +1078,7 @@
|
||||
)
|
||||
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod nav-graph-editor-method-32 nav-graph-editor ((this nav-graph-editor) (arg0 symbol) (arg1 int))
|
||||
(defmethod nav-graph-editor-method-32 ((this nav-graph-editor) (arg0 symbol) (arg1 int))
|
||||
(rlet ((vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
@@ -1155,13 +1147,13 @@
|
||||
)
|
||||
)
|
||||
|
||||
(defmethod nav-graph-editor-method-47 nav-graph-editor ((this nav-graph-editor))
|
||||
(defmethod nav-graph-editor-method-47 ((this nav-graph-editor))
|
||||
(+! (-> this command-id) 1)
|
||||
(-> this command-id)
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod nav-graph-editor-method-48 nav-graph-editor ((this nav-graph-editor) (arg0 uint))
|
||||
(defmethod nav-graph-editor-method-48 ((this nav-graph-editor) (arg0 uint))
|
||||
"TODO - enum / com-type"
|
||||
(let* ((v1-1 (-> this command-array length))
|
||||
(v0-0 (-> this command-array data v1-1))
|
||||
@@ -1174,18 +1166,18 @@
|
||||
)
|
||||
)
|
||||
|
||||
(defmethod nav-graph-editor-method-49 nav-graph-editor ((this nav-graph-editor))
|
||||
(defmethod nav-graph-editor-method-49 ((this nav-graph-editor))
|
||||
(-> this command-array data (+ (-> this command-array length) -1))
|
||||
)
|
||||
|
||||
(defmethod nav-graph-editor-method-50 nav-graph-editor ((this nav-graph-editor))
|
||||
(defmethod nav-graph-editor-method-50 ((this nav-graph-editor))
|
||||
(+! (-> this command-array length) -1)
|
||||
(set! (-> this max-command) (-> this command-array length))
|
||||
(none)
|
||||
)
|
||||
|
||||
;; WARN: new jak 2 until loop case, check carefully
|
||||
(defmethod nav-graph-editor-method-58 nav-graph-editor ((this nav-graph-editor))
|
||||
(defmethod nav-graph-editor-method-58 ((this nav-graph-editor))
|
||||
(if (zero? (-> this command-array length))
|
||||
(return #f)
|
||||
)
|
||||
@@ -1242,7 +1234,7 @@
|
||||
#f
|
||||
)
|
||||
|
||||
(defmethod nav-graph-editor-method-51 nav-graph-editor ((this nav-graph-editor))
|
||||
(defmethod nav-graph-editor-method-51 ((this nav-graph-editor))
|
||||
(let ((gp-0 (alloc-new-node! (-> this nav-graph))))
|
||||
(when (!= gp-0 -1)
|
||||
(let ((v1-6 (-> this nav-graph node-array data gp-0))
|
||||
@@ -1261,7 +1253,7 @@
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod nav-graph-editor-method-53 nav-graph-editor ((this nav-graph-editor) (arg0 int) (arg1 int))
|
||||
(defmethod nav-graph-editor-method-53 ((this nav-graph-editor) (arg0 int) (arg1 int))
|
||||
(let ((s5-0 (indexof-visnode (-> this nav-graph) arg0 arg1)))
|
||||
(if (= s5-0 -1)
|
||||
(set! s5-0 (alloc-new-visnode! (-> this nav-graph) arg0 arg1))
|
||||
@@ -1275,7 +1267,7 @@
|
||||
)
|
||||
|
||||
;; WARN: Return type mismatch int vs uint.
|
||||
(defmethod nav-graph-editor-method-52 nav-graph-editor ((this nav-graph-editor))
|
||||
(defmethod nav-graph-editor-method-52 ((this nav-graph-editor))
|
||||
(let ((gp-0 (alloc-new-edge! (-> this nav-graph))))
|
||||
(when (!= gp-0 -1)
|
||||
(let ((v1-6 (-> this nav-graph edge-array data gp-0))
|
||||
@@ -1298,7 +1290,7 @@
|
||||
)
|
||||
)
|
||||
|
||||
(defmethod nav-graph-editor-method-57 nav-graph-editor ((this nav-graph-editor) (arg0 int) (arg1 int))
|
||||
(defmethod nav-graph-editor-method-57 ((this nav-graph-editor) (arg0 int) (arg1 int))
|
||||
(case (indexof-visnode (-> this nav-graph) arg0 arg1)
|
||||
((-1)
|
||||
(return (the-as int #f))
|
||||
@@ -1314,7 +1306,7 @@
|
||||
0
|
||||
)
|
||||
|
||||
(defmethod nav-graph-editor-method-55 nav-graph-editor ((this nav-graph-editor) (arg0 int))
|
||||
(defmethod nav-graph-editor-method-55 ((this nav-graph-editor) (arg0 int))
|
||||
(nav-graph-editor-method-47 this)
|
||||
(let ((s5-0 (-> this nav-graph node-array data arg0)))
|
||||
(logior! (-> s5-0 mysql-save-flag) (mysql-save-flag delete))
|
||||
@@ -1344,7 +1336,7 @@
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod nav-graph-editor-method-56 nav-graph-editor ((this nav-graph-editor) (arg0 int))
|
||||
(defmethod nav-graph-editor-method-56 ((this nav-graph-editor) (arg0 int))
|
||||
(nav-graph-editor-method-47 this)
|
||||
(let ((s5-0 (-> this nav-graph edge-array data arg0)))
|
||||
(logior! (-> s5-0 mysql-save-flag) (mysql-save-flag delete))
|
||||
@@ -1389,7 +1381,7 @@
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod nav-graph-editor-method-59 nav-graph-editor ((this nav-graph-editor))
|
||||
(defmethod nav-graph-editor-method-59 ((this nav-graph-editor))
|
||||
(if (cpad-pressed? 0 triangle)
|
||||
(nav-graph-editor-method-58 this)
|
||||
)
|
||||
@@ -1400,7 +1392,7 @@
|
||||
)
|
||||
)
|
||||
|
||||
(defmethod nav-graph-editor-method-46 nav-graph-editor ((this nav-graph-editor))
|
||||
(defmethod nav-graph-editor-method-46 ((this nav-graph-editor))
|
||||
(if (cpad-pressed? 0 up)
|
||||
(go (method-of-object this create))
|
||||
)
|
||||
@@ -1427,7 +1419,7 @@
|
||||
)
|
||||
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod nav-graph-editor-method-35 nav-graph-editor ((this nav-graph-editor))
|
||||
(defmethod nav-graph-editor-method-35 ((this nav-graph-editor))
|
||||
(nav-graph-editor-method-34 this)
|
||||
(nav-graph-editor-method-32 this (-> this selected-node-edge?) (-> this selected-index))
|
||||
(cond
|
||||
@@ -1531,7 +1523,7 @@
|
||||
)
|
||||
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod nav-graph-editor-method-38 nav-graph-editor ((this nav-graph-editor))
|
||||
(defmethod nav-graph-editor-method-38 ((this nav-graph-editor))
|
||||
(nav-graph-editor-method-41 this)
|
||||
(nav-graph-editor-method-34 this)
|
||||
(nav-graph-editor-method-42 this)
|
||||
@@ -1616,7 +1608,7 @@
|
||||
)
|
||||
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod nav-graph-editor-method-37 nav-graph-editor ((this nav-graph-editor))
|
||||
(defmethod nav-graph-editor-method-37 ((this nav-graph-editor))
|
||||
(nav-graph-editor-method-41 this)
|
||||
(nav-graph-editor-method-34 this)
|
||||
(nav-graph-editor-method-42 this)
|
||||
@@ -1799,7 +1791,7 @@
|
||||
)
|
||||
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod nav-graph-editor-method-39 nav-graph-editor ((this nav-graph-editor))
|
||||
(defmethod nav-graph-editor-method-39 ((this nav-graph-editor))
|
||||
(nav-graph-editor-method-41 this)
|
||||
(nav-graph-editor-method-34 this)
|
||||
(nav-graph-editor-method-42 this)
|
||||
@@ -1858,7 +1850,7 @@
|
||||
)
|
||||
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod nav-graph-editor-method-40 nav-graph-editor ((this nav-graph-editor))
|
||||
(defmethod nav-graph-editor-method-40 ((this nav-graph-editor))
|
||||
(nav-graph-editor-method-41 this)
|
||||
(nav-graph-editor-method-34 this)
|
||||
(nav-graph-editor-method-43 this)
|
||||
@@ -1956,7 +1948,7 @@
|
||||
)
|
||||
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod nav-graph-editor-method-36 nav-graph-editor ((this nav-graph-editor))
|
||||
(defmethod nav-graph-editor-method-36 ((this nav-graph-editor))
|
||||
(nav-graph-editor-method-41 this)
|
||||
(nav-graph-editor-method-34 this)
|
||||
(nav-graph-editor-method-42 this)
|
||||
|
||||
Reference in New Issue
Block a user