jak-project/goal_src/engine/entity/entity.gc
water111 f516737cf7
[decompile] bsp-h (#562)
* decompile bsp-h

* a few more

* some more

* fix merge conflicts
2021-06-07 18:30:16 -04:00

95 lines
2.2 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: entity.gc
;; name in dgo: entity
;; dgos: GAME, ENGINE
;; needs cleanup, but this does work!
(defun entity-by-name ((arg0 string))
(dotimes (s5-0 (-> *level* length))
(let ((s4-0 (the-as basic (-> *level* level s5-0))))
(when (= (-> (the-as level s4-0) status) 'active)
(let ((s3-0 (-> (the-as level s4-0) bsp actors)))
(when (nonzero? s3-0)
(dotimes (s2-0 (-> s3-0 length))
(let ((s1-0 (-> s3-0 data s2-0 actor)))
(if
(name=
(the-as
basic
((method-of-type res-lump get-property-struct)
(the-as res-lump s1-0)
'name
'interp
-1000000000.0
#f
(the-as (pointer res-tag) #f)
*res-static-buf*
)
)
arg0
)
(return (the entity s1-0))
)
)
)
)
)
(let ((s3-1 (-> (the-as level s4-0) bsp ambients)))
(when (nonzero? s3-1)
(dotimes (s2-1 (-> s3-1 length))
(let ((s1-1 (-> s3-1 data s2-1 ambient)))
(if
(name=
(the-as
basic
((method-of-type res-lump get-property-struct)
(the-as res-lump s1-1)
'name
'interp
-1000000000.0
#f
(the-as (pointer res-tag) #f)
*res-static-buf*
)
)
arg0
)
(return (the entity s1-1))
)
)
)
)
)
(set! s4-0 (-> (the-as level s4-0) bsp cameras))
(when (nonzero? (the-as (array entity-camera) s4-0))
(dotimes (s3-2 (-> (the-as (array entity-camera) s4-0) length))
(let ((s2-2 (-> (the-as (array entity-camera) s4-0) s3-2)))
(if
(name=
(the-as
basic
((method-of-type res-lump get-property-struct)
s2-2
'name
'interp
-1000000000.0
#f
(the-as (pointer res-tag) #f)
*res-static-buf*
)
)
arg0
)
(return (the entity s2-2))
)
)
)
)
)
)
)
(the-as entity #f)
)