support non-virtual gos in decompiler (#707)

This commit is contained in:
water111
2021-07-17 18:07:21 -04:00
committed by GitHub
parent 0ed587cba9
commit b70fcb2f7a
48 changed files with 824 additions and 733 deletions
@@ -548,56 +548,49 @@
(sphere-count int)
(nearest-y-threshold-default float)
)
(with-pp
(let
((obj
(object-new
allocation
type-to-make
(the-as int (+ (-> type-to-make size) (the-as uint (* sphere-count 16))))
)
(let
((obj
(object-new
allocation
type-to-make
(the-as int (+ (-> type-to-make size) (the-as uint (* sphere-count 16))))
)
)
(when (zero? obj)
(let ((t9-1 (the-as function enter-state))
(a0-1 "memory")
)
(set! (-> pp next-state) process-drawable-art-error)
((the-as (function string none) t9-1) a0-1)
)
(set! obj (the-as nav-control 0))
(goto cfg-4)
)
(set! (-> obj max-spheres) sphere-count)
(set! (-> obj flags) (nav-control-flags bit8 bit13))
(set! (-> obj mesh) (nav-mesh-connect (-> shape process) shape obj))
(let ((ent (-> shape process entity)))
(set!
(-> obj nearest-y-threshold)
((method-of-type res-lump get-property-value-float)
ent
'nearest-y-threshold
'interp
-1000000000.0
nearest-y-threshold-default
(the-as (pointer res-tag) #f)
*res-static-buf*
)
)
)
(set! (-> obj shape) shape)
(set! (-> obj process) (-> shape process))
(set! (-> obj gap-event) #f)
(set! (-> obj current-poly) #f)
(set! (-> obj next-poly) #f)
(set! (-> obj target-poly) #f)
(set! (-> obj user-poly) #f)
(set! (-> obj portal 0) #f)
(set! (-> obj portal 1) #f)
(set! (-> obj nav-cull-radius) 40960.0)
(label cfg-4)
(the-as nav-control obj)
)
(when (zero? obj)
(go process-drawable-art-error "memory")
(set! obj (the-as nav-control 0))
(goto cfg-4)
)
(set! (-> obj max-spheres) sphere-count)
(set! (-> obj flags) (nav-control-flags bit8 bit13))
(set! (-> obj mesh) (nav-mesh-connect (-> shape process) shape obj))
(let ((ent (-> shape process entity)))
(set!
(-> obj nearest-y-threshold)
((method-of-type res-lump get-property-value-float)
ent
'nearest-y-threshold
'interp
-1000000000.0
nearest-y-threshold-default
(the-as (pointer res-tag) #f)
*res-static-buf*
)
)
)
(set! (-> obj shape) shape)
(set! (-> obj process) (-> shape process))
(set! (-> obj gap-event) #f)
(set! (-> obj current-poly) #f)
(set! (-> obj next-poly) #f)
(set! (-> obj target-poly) #f)
(set! (-> obj user-poly) #f)
(set! (-> obj portal 0) #f)
(set! (-> obj portal 1) #f)
(set! (-> obj nav-cull-radius) 40960.0)
(label cfg-4)
(the-as nav-control obj)
)
)
@@ -78,66 +78,59 @@
(time float)
)
(local-vars (tag res-tag))
(with-pp
(let
((obj
(object-new allocation type-to-make (the-as int (-> type-to-make size)))
)
(let
((obj
(object-new allocation type-to-make (the-as int (-> type-to-make size)))
)
(when (zero? obj)
(let ((t9-1 (the-as function enter-state))
(a0-1 "memory")
)
(set! (-> pp next-state) process-drawable-art-error)
((the-as (function string none) t9-1) a0-1)
)
(set! obj (the-as path-control 0))
(goto cfg-9)
)
(set! (-> obj process) (the-as process-drawable proc))
(set! (-> obj name) name)
(let ((ent (-> proc entity)))
(when (= name 'path)
(let ((lookup-entity (entity-actor-lookup ent 'path-actor 0)))
(if lookup-entity
(set! ent lookup-entity)
)
)
)
(set! tag (new 'static 'res-tag))
(let
((data
((method-of-type res-lump get-property-data)
ent
name
'interp
time
(the-as pointer #f)
(& tag)
*res-static-buf*
)
)
)
(cond
(data
(set! (-> obj cverts) (the-as (inline-array vector) data))
(set! (-> obj curve num-cverts) (the-as int (-> tag elt-count)))
)
(else
(set!
(-> obj flags)
(logior (-> obj flags) (path-control-flag not-found))
)
(set! (-> obj cverts) (the-as (inline-array vector) #f))
(set! (-> obj curve num-cverts) 0)
0
)
)
)
)
(label cfg-9)
(the-as path-control obj)
)
(when (zero? obj)
(go process-drawable-art-error "memory")
(set! obj (the-as path-control 0))
(goto cfg-9)
)
(set! (-> obj process) (the-as process-drawable proc))
(set! (-> obj name) name)
(let ((ent (-> proc entity)))
(when (= name 'path)
(let ((lookup-entity (entity-actor-lookup ent 'path-actor 0)))
(if lookup-entity
(set! ent lookup-entity)
)
)
)
(set! tag (new 'static 'res-tag))
(let
((data
((method-of-type res-lump get-property-data)
ent
name
'interp
time
(the-as pointer #f)
(& tag)
*res-static-buf*
)
)
)
(cond
(data
(set! (-> obj cverts) (the-as (inline-array vector) data))
(set! (-> obj curve num-cverts) (the-as int (-> tag elt-count)))
)
(else
(set!
(-> obj flags)
(logior (-> obj flags) (path-control-flag not-found))
)
(set! (-> obj cverts) (the-as (inline-array vector) #f))
(set! (-> obj curve num-cverts) 0)
0
)
)
)
)
(label cfg-9)
(the-as path-control obj)
)
)