mirror of
https://github.com/open-goal/jak-project
synced 2026-09-12 04:49:19 -04:00
[decompiler] as-type and font method support (#3855)
Add support for `as-type` macro, and detecting inline font methods. This works in all three games but I've only updated jak 3's goal_src for now. Eventually I will go back and work through the others, but I want to get more decompiler features in first.  --------- Co-authored-by: water111 <awaterford1111445@gmail.com>
This commit is contained in:
@@ -256,6 +256,18 @@ This is the main vector type."
|
||||
#f
|
||||
)
|
||||
|
||||
(defmacro as-type (this type)
|
||||
"If this is the specified type, return this cast to that type. Otherwise, return #f."
|
||||
(with-gensyms (obj)
|
||||
`(the ,type (let ((,obj ,this))
|
||||
(if (type? ,obj ,type)
|
||||
,obj
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(defun find-parent-method ((typ type) (method-id int))
|
||||
"Find the closest parent type that has a different implementation of the given method and return that method.
|
||||
If it does not exist, return `nothing` function.
|
||||
|
||||
Reference in New Issue
Block a user