mirror of
https://github.com/open-goal/jak-project
synced 2026-09-10 04:22:13 -04:00
[decomp] get started on game info (#674)
* temp * menu text * wip * recognize handle to process * more
This commit is contained in:
@@ -17,10 +17,17 @@
|
||||
(defenum entity-perm-status
|
||||
:bitfield #t
|
||||
:type uint16
|
||||
(bit-0 0)
|
||||
(bit-1 1)
|
||||
(dead 2)
|
||||
(unknown 5) ;; TODO - task-control::task-cstage::14
|
||||
(complete 6))
|
||||
(bit-3 3)
|
||||
(bit-4 4)
|
||||
(user-set-from-cstage 5)
|
||||
(complete 6)
|
||||
(bit-7 7)
|
||||
(real-complete 8)
|
||||
(bit-9 9)
|
||||
)
|
||||
|
||||
;; definition of type entity-perm
|
||||
(deftype entity-perm (structure)
|
||||
@@ -44,15 +51,15 @@
|
||||
:size-assert #x10
|
||||
:flag-assert #xa00000010
|
||||
(:methods
|
||||
(dummy-9 () none 9)
|
||||
)
|
||||
(update-perm! (_type_ symbol entity-perm-status) _type_ 9)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition of type entity-links
|
||||
(deftype entity-links (structure)
|
||||
((prev-link entity-links :offset-assert 0)
|
||||
(next-link entity-links :offset-assert 4)
|
||||
(entity basic :offset-assert 8)
|
||||
(entity entity :offset-assert 8)
|
||||
(process process :offset-assert 12)
|
||||
(level level :offset-assert 16)
|
||||
(vis-id int32 :offset-assert 20)
|
||||
@@ -82,7 +89,8 @@
|
||||
|
||||
;; definition of type entity-links-array
|
||||
(deftype entity-links-array (inline-array-class)
|
||||
()
|
||||
((data entity-links :inline :dynamic :offset-assert 16)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x10
|
||||
:flag-assert #x900000010
|
||||
@@ -220,3 +228,5 @@
|
||||
(defun-extern entity-by-name string entity)
|
||||
(defun-extern entity-by-type type entity-actor)
|
||||
(defun-extern entity-by-aid uint entity)
|
||||
(define-extern reset-actors (function symbol none))
|
||||
(define-extern *spawn-actors* symbol)
|
||||
@@ -5,6 +5,18 @@
|
||||
;; name in dgo: entity-table
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
;; The *entity-info* table contains some simple information that can be used to
|
||||
;; spawn a process for an entity.
|
||||
;; :ptype the type of the process
|
||||
;; :package the package that must be loaded (not used?)
|
||||
;; :art-group the art that must be loaded
|
||||
;; :pool the pool that the process should be allocated from
|
||||
;; :heap-size the required size for the process heap
|
||||
|
||||
;; At one point, this was much bigger, but got smaller between
|
||||
;; the demo and final build. The entity info is possibly stored somewhere else
|
||||
;; and this may not even be used.
|
||||
|
||||
(define *entity-info*
|
||||
(new 'static 'boxed-array :type entity-info :length 19 :allocated-length 19
|
||||
(new 'static 'entity-info
|
||||
@@ -155,20 +167,24 @@
|
||||
(the-as entity-info
|
||||
(cond
|
||||
((nonzero? (-> arg0 method-table 13))
|
||||
;; we already cached the type in the method table
|
||||
(-> arg0 method-table 13)
|
||||
)
|
||||
(else
|
||||
;; search the table
|
||||
(let ((v1-1 *entity-info*))
|
||||
(dotimes (a1-0 (-> v1-1 length))
|
||||
(when (= arg0 (-> v1-1 a1-0 ptype))
|
||||
(set!
|
||||
(-> arg0 method-table 13)
|
||||
;; found it, cache it in the method table
|
||||
(set! (-> arg0 method-table 13)
|
||||
(the-as function (-> v1-1 a1-0))
|
||||
)
|
||||
(return (-> v1-1 a1-0))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; didn't find it, cache and return #f
|
||||
(set! (-> arg0 method-table 13) #f)
|
||||
#f
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user