Files
jak-project/goal_src/jak2/engine/util/glist.gc
T
ManDude 324def1303 split new pc features in some files into their own code files + address some old issues + ripple graphics improvements (#2216)
Moves PC-specific entity and debug menu things to `entity-debug.gc` and
`default-menu-pc.gc` respectively and makes `(declare-file (debug))`
work as it should (no need to wrap the entire file in `(when
*debug-segment*` now!).

Also changes the DGO descriptor format so that it's less verbose. It
might break custom levels, but the format change is very simple so it
should not be difficult for anyone to update to the new format. Sadly,
you lose the completely useless ability to use DGO object names that
don't match the source file name. The horror!

I've also gone ahead and expanded the force envmap option to also force
the ripple effect to be active. I did not notice any performance or
visual drawbacks from this. Gets rid of some distracting LOD and some
water pools appearing super flat (and pitch back for dark eco).

Fixes #1424
2023-02-13 21:39:14 +00:00

218 lines
6.1 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: glist.gc
;; name in dgo: glist
;; dgos: ENGINE, GAME
;; DECOMP BEGINS
;; this file is debug only
(declare-file (debug))
;; definition for function glst-num-elements
(defun glst-num-elements ((arg0 glst-list))
"Returns `numelem` from the provided [[glst-list]]"
(-> arg0 numelem)
)
;; definition for function glst-remove
(defun glst-remove ((arg0 glst-list) (arg1 glst-node))
"Removes the provided [[glst-node]] from the list and returns it back"
(let ((v1-0 arg1))
"return the previous node in the list"
(let ((v1-1 (-> v1-0 prev))
(a2-1 arg1)
)
"return the next node in the list"
(let ((a2-2 (-> a2-1 next)))
(set! (-> v1-1 next) a2-2)
(set! (-> a2-2 prev) v1-1)
)
)
)
(+! (-> arg0 numelem) -1)
arg1
)
;; definition for function glst-remove-tail
(defun glst-remove-tail ((arg0 glst-list))
"Removes the tail of the [[glst-list]], returns #f if the list is empty, otherwise returns the [[glst-node]] that was removed"
(let ((v1-0 arg0))
"return the tail of the list"
(let* ((a1-1 (-> v1-0 tailpred))
(v1-1 a1-1)
)
"is this node the start of the list. #t = start"
(if (not (not (-> v1-1 prev)))
(glst-remove arg0 a1-1)
(the-as glst-node #f)
)
)
)
)
;; definition for function glst-remove-head
(defun glst-remove-head ((arg0 glst-list))
"Removes the head of the [[glst-list]], returns #f if the list is empty, otherwise returns the [[glst-node]] that was removed"
(let ((v1-0 arg0))
"return the start of the list"
(let* ((a1-1 (-> v1-0 head))
(v1-1 a1-1)
)
"is this node the end of the list. #t = end"
(if (not (not (-> v1-1 next)))
(glst-remove arg0 a1-1)
(the-as glst-node #f)
)
)
)
)
;; definition for function glst-insert-before
(defun glst-insert-before ((list glst-list) (curr glst-node) (new glst-node))
"Inserts `new` before `curr`, returns the newly inserted [[glst-node]]"
(let ((v1-0 curr))
"return the previous node in the list"
(let ((v1-1 (-> v1-0 prev)))
(set! (-> new prev) v1-1)
(set! (-> new next) curr)
(set! (-> v1-1 next) new)
)
)
(set! (-> curr prev) new)
(+! (-> list numelem) 1)
new
)
;; definition for function glst-insert-after
(defun glst-insert-after ((list glst-list) (curr glst-node) (new glst-node))
"Inserts `new` after `curr`, returns the newly inserted [[glst-node]]"
(let ((v1-0 curr))
"return the next node in the list"
(let ((v1-1 (-> v1-0 next)))
(set! (-> new prev) curr)
(set! (-> new next) v1-1)
(set! (-> v1-1 prev) new)
)
)
(set! (-> curr next) new)
(+! (-> list numelem) 1)
new
)
;; definition for function glst-add-tail
(defun glst-add-tail ((arg0 glst-list) (arg1 glst-node))
"Adds the provided [[glst-node]] to the end of the [[glst-list]]"
(glst-insert-before arg0 (the-as glst-node (&-> arg0 tail)) arg1)
arg1
)
;; definition for function glst-add-head
(defun glst-add-head ((arg0 glst-list) (arg1 glst-node))
"Adds the provided [[glst-node]] to the beginning of the [[glst-list]]"
(glst-insert-after arg0 (the-as glst-node arg0) arg1)
arg1
)
;; definition for function glst-init-list!
(defun glst-init-list! ((arg0 glst-list))
"Clears the provided [[glst-list]]"
(set! (-> arg0 head) (the-as glst-node (&-> arg0 tail)))
(set! (-> arg0 tail) #f)
(set! (-> arg0 tailpred) (the-as glst-node (&-> arg0 head)))
(set! (-> arg0 numelem) 0)
arg0
)
;; definition for function glst-find-node-by-name
(defun glst-find-node-by-name ((arg0 glst-list) (arg1 string))
"Returns the [[glst-named-node]] by examining it's `privname`, returns #f if nothing is found"
(let ((v1-0 arg0))
"return the start of the list"
(let ((s5-0 (-> v1-0 head)))
(while (let ((v1-6 s5-0))
"is this node the end of the list. #t = end"
(not (not (-> v1-6 next)))
)
(if (name= (-> (the-as glst-named-node s5-0) privname) arg1)
(return s5-0)
)
"return the next node in the list"
(set! s5-0 (-> s5-0 next))
)
)
)
(the-as glst-node #f)
)
;; definition for function glst-get-node-by-index
(defun glst-get-node-by-index ((arg0 glst-list) (arg1 int))
"Returns the [[glst-node]] by index, returns #f if nothing is found"
(when (and (< arg1 (glst-num-elements arg0)) (>= arg1 0))
"return the start of the list"
(let ((v1-3 (-> arg0 head)))
(dotimes (a0-3 arg1)
(nop!)
(nop!)
(nop!)
(nop!)
"return the next node in the list"
(set! v1-3 (-> v1-3 next))
)
(return v1-3)
)
)
(the-as glst-node #f)
)
;; definition for function glst-length-of-longest-name
(defun glst-length-of-longest-name ((arg0 glst-list))
"Returns the length of the longest `privname`"
(let ((gp-0 0))
(let ((v1-0 arg0))
"return the start of the list"
(let ((s5-0 (-> v1-0 head)))
(while (let ((v1-6 s5-0))
"is this node the end of the list. #t = end"
(not (not (-> v1-6 next)))
)
(let ((v1-3 (length (-> (the-as glst-named-node s5-0) privname))))
(if (< gp-0 v1-3)
(set! gp-0 v1-3)
)
)
"return the next node in the list"
(set! s5-0 (-> s5-0 next))
)
)
)
gp-0
)
)
;; definition for function glst-get-node-index
(defun glst-get-node-index ((arg0 glst-list) (arg1 glst-node))
"Given a [[glst-node]] return it's position in the [[glst-list]]"
(let ((v1-0 0))
"return the start of the list"
(let ((a0-1 (-> arg0 head)))
(while (let ((a2-3 a0-1))
"is this node the end of the list. #t = end"
(not (not (-> a2-3 next)))
)
(if (= a0-1 arg1)
(return v1-0)
)
(+! v1-0 1)
"return the next node in the list"
(set! a0-1 (-> a0-1 next))
)
)
)
-1
)