mirror of
https://github.com/open-goal/jak-project
synced 2026-08-28 00:41:58 -04:00
decompiler: Apply docstring indentation fix to all game versions (#3614)
Previously was only applying to game versions above Jak 2, Fixes #3342
This commit is contained in:
@@ -54,12 +54,8 @@ void append_body_to_function_definition(goos::Object* top_form,
|
||||
body_elements.insert(body_elements.end(), inline_body.begin(), inline_body.end());
|
||||
// If the first element in the body is a docstring, add it first
|
||||
if (body_elements.size() > 0 && body_elements.at(0).is_string()) {
|
||||
if (version > GameVersion::Jak2) {
|
||||
initial_top_level_forms.push_back(
|
||||
goos::StringObject::make_new(fix_docstring_indent(inline_body.at(0).as_string()->data)));
|
||||
} else {
|
||||
initial_top_level_forms.push_back(inline_body.at(0));
|
||||
}
|
||||
initial_top_level_forms.push_back(
|
||||
goos::StringObject::make_new(fix_docstring_indent(inline_body.at(0).as_string()->data)));
|
||||
body_elements.erase(body_elements.begin());
|
||||
}
|
||||
|
||||
|
||||
+26
-26
@@ -38,31 +38,31 @@
|
||||
;; definition for method 118 of type enemy
|
||||
(defmethod rnd-float-range ((this enemy) (low float) (high float))
|
||||
"@param low The lower bound of the range (inclusive)
|
||||
@param high The upper bound of the range (exclusive)
|
||||
@returns A random float in the specified range"
|
||||
@param high The upper bound of the range (exclusive)
|
||||
@returns A random float in the specified range"
|
||||
(+ low (* (rand-vu) (- high low)))
|
||||
)
|
||||
|
||||
;; definition for method 119 of type enemy
|
||||
(defmethod rnd-int-count ((this enemy) (high int))
|
||||
"@param high The upper bound of the range (exclusive)
|
||||
@returns a random integer in the range 0 to `high`
|
||||
@see [[rand-vu]]"
|
||||
@returns a random integer in the range 0 to `high`
|
||||
@see [[rand-vu]]"
|
||||
(the int (* (rand-vu) (the float high)))
|
||||
)
|
||||
|
||||
;; definition for method 121 of type enemy
|
||||
(defmethod rnd-int-range ((this enemy) (low int) (high int))
|
||||
"@param low The lower bound of the range (inclusive)
|
||||
@param high The upper bound of the range (exclusive)
|
||||
@returns A random integer in the specified range"
|
||||
@param high The upper bound of the range (exclusive)
|
||||
@returns A random integer in the specified range"
|
||||
(+ low (the int (* (rand-vu) (the float (+ (- 1 low) high)))))
|
||||
)
|
||||
|
||||
;; definition for method 122 of type enemy
|
||||
(defmethod rnd-percent? ((this enemy) (chance float))
|
||||
"@param chance The value to compare ([[>=]]) with the result from [[rand-vu]].
|
||||
@returns If `chance` is greater than the random draw"
|
||||
@returns If `chance` is greater than the random draw"
|
||||
(>= chance (rand-vu))
|
||||
)
|
||||
|
||||
@@ -202,7 +202,7 @@
|
||||
;; definition for method 59 of type enemy
|
||||
(defmethod get-penetrate-info ((this enemy))
|
||||
"@returns the allowed way(s) this enemy can take damage
|
||||
@see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]"
|
||||
@see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]"
|
||||
(penetrated-by-all&hit-points->penetrated-by (-> this penetrated-by-all) (-> this hit-points))
|
||||
)
|
||||
|
||||
@@ -303,9 +303,9 @@
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod common-post ((self enemy))
|
||||
"Does a lot of various things relating to interacting with the target
|
||||
- tracks when the enemy was last drawn
|
||||
- looks at the target and handles attacking
|
||||
@TODO Not extremely well understood yet"
|
||||
- tracks when the enemy was last drawn
|
||||
- looks at the target and handles attacking
|
||||
@TODO Not extremely well understood yet"
|
||||
(if (and (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-control-status on-screen)))
|
||||
(set-time! (-> self last-draw-time))
|
||||
)
|
||||
@@ -803,7 +803,7 @@
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod look-at-target! ((this enemy) (arg0 enemy-flag))
|
||||
"Logic for looking at the target that is locked on, sets some flags and adjusts the neck to look at the target if available
|
||||
@param flag Reacts to [[enemy-flag::death-start]] and [[enemy-flag::enable-on-active]], see implementation for details"
|
||||
@param flag Reacts to [[enemy-flag::death-start]] and [[enemy-flag::enable-on-active]], see implementation for details"
|
||||
(case arg0
|
||||
(((enemy-flag look-at-focus))
|
||||
(logclear! (-> this enemy-flags) (enemy-flag look-at-move-dest))
|
||||
@@ -846,7 +846,7 @@
|
||||
;; definition for method 126 of type enemy
|
||||
(defmethod enemy-above-ground? ((this enemy) (arg0 collide-query) (arg1 vector) (arg2 collide-spec) (arg3 float) (arg4 float) (arg5 float))
|
||||
"@returns if the enemy is above the ground or not
|
||||
@see [[above-ground?]]"
|
||||
@see [[above-ground?]]"
|
||||
(above-ground? (-> this root) arg0 arg1 arg2 arg3 arg4 arg5)
|
||||
)
|
||||
|
||||
@@ -1060,7 +1060,7 @@
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod set-enemy-info! ((this enemy) (arg0 enemy-info))
|
||||
"In addition to setting the `enemy-info`, also init the `neck-joint` if applicable from it
|
||||
@param info Set `enemy-info` accordingly"
|
||||
@param info Set `enemy-info` accordingly"
|
||||
(set! (-> this enemy-info) arg0)
|
||||
(when (and (!= (-> this enemy-info neck-joint) -1) (zero? (-> this neck)))
|
||||
(set! (-> this neck)
|
||||
@@ -1291,11 +1291,11 @@
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this enemy) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(init-enemy-collision! this)
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(init-enemy! this)
|
||||
@@ -1351,10 +1351,10 @@ This commonly includes things such as:
|
||||
;; definition for method 98 of type enemy
|
||||
(defmethod in-aggro-range? ((this enemy) (arg0 process-focusable) (arg1 vector))
|
||||
"Should the enemy activate.
|
||||
- if `activate-distance` is `0.0`, always true
|
||||
- otherwise, check if the provided process is close enough
|
||||
@param proc The process used to distance check
|
||||
@returns true/false"
|
||||
- if `activate-distance` is `0.0`, always true
|
||||
- otherwise, check if the provided process is close enough
|
||||
@param proc The process used to distance check
|
||||
@returns true/false"
|
||||
#t
|
||||
)
|
||||
|
||||
@@ -1528,8 +1528,8 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch int vs enemy-aware.
|
||||
(defmethod update-target-awareness! ((this enemy) (arg0 process-focusable) (arg1 enemy-best-focus))
|
||||
"Checks a variety of criteria to determine the level of awareness the enemy is of the target. Sets `aware` and related fields as well!
|
||||
@TODO - flesh out docs
|
||||
@returns the value that sets `aware`"
|
||||
@TODO - flesh out docs
|
||||
@returns the value that sets `aware`"
|
||||
(let ((f30-0 (vector-vector-distance (get-trans arg0 0) (-> this root trans)))
|
||||
(s3-1 #f)
|
||||
(s2-0 #f)
|
||||
@@ -1673,7 +1673,7 @@ This commonly includes things such as:
|
||||
;; INFO: Used lq/sq
|
||||
(defmethod general-event-handler ((this enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
||||
"Handles various events for the enemy
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
(local-vars (s5-5 rgbaf) (sv-432 process) (sv-448 event-message-block))
|
||||
(cond
|
||||
((= arg2 'track)
|
||||
|
||||
+1
-1
@@ -123,7 +123,7 @@
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod play-communicator-speech! ((this talker-speech-class))
|
||||
"Plays the provided [[talker-speech-class]]
|
||||
@TODO - understand the array from [[game-info]] better"
|
||||
@TODO - understand the array from [[game-info]] better"
|
||||
(set! (-> *game-info* unknown-pad6 (+ (* (-> this speech) 2) 1)) (the-as uint #xffff))
|
||||
0
|
||||
(none)
|
||||
|
||||
+4
-4
@@ -141,10 +141,10 @@
|
||||
;; definition for method 10 of type align-control
|
||||
(defmethod align! ((this align-control) (options align-opts) (x float) (y float) (z float))
|
||||
"As long as [[align-flags::0]] is not set call [[process-drawable::16]] on the process being controlled
|
||||
using the arguments passed to construct a [[vector]] - <`x`, `y`, `z`, 1.0>
|
||||
|
||||
@returns the `root` of the [[process-drawable]] after the method returns
|
||||
@see [[process-drawable::16]]"
|
||||
using the arguments passed to construct a [[vector]] - <`x`, `y`, `z`, 1.0>
|
||||
|
||||
@returns the `root` of the [[process-drawable]] after the method returns
|
||||
@see [[process-drawable::16]]"
|
||||
(when (not (logtest? (-> this flags) (align-flags disabled)))
|
||||
(let* ((process (-> this process))
|
||||
(method-call (method-of-object process apply-alignment))
|
||||
|
||||
+3
-3
@@ -41,9 +41,9 @@
|
||||
;; definition for function camera-pos
|
||||
(defun camera-pos ()
|
||||
"Returns the `trans` vector from whatever is first determined to exist:
|
||||
- [[*camera-combiner*]]
|
||||
- [[*math-camera*]]
|
||||
- else, [[*camera-dummy-vector*]]"
|
||||
- [[*camera-combiner*]]
|
||||
- [[*math-camera*]]
|
||||
- else, [[*camera-dummy-vector*]]"
|
||||
(cond
|
||||
(*camera-combiner*
|
||||
(-> *camera-combiner* trans)
|
||||
|
||||
+18
-18
@@ -43,7 +43,7 @@
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod init-plat! ((this base-plat))
|
||||
"Does any necessary initial platform setup.
|
||||
For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound."
|
||||
For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound."
|
||||
0
|
||||
(none)
|
||||
)
|
||||
@@ -64,8 +64,8 @@ For example for an elevator pre-compute the distance between the first and last
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod start-bouncing! ((this base-plat))
|
||||
"Sets `bouncing` to [[#t]] and sets up the clock to periodically bounce
|
||||
and translate the platform via the `smush`
|
||||
@see [[smush-control]]"
|
||||
and translate the platform via the `smush`
|
||||
@see [[smush-control]]"
|
||||
(activate! (-> this smush) -1.0 60 150 1.0 1.0 (-> self clock))
|
||||
(set-time! (-> this bounce-time))
|
||||
(set! (-> this bouncing) #t)
|
||||
@@ -81,8 +81,8 @@ and translate the platform via the `smush`
|
||||
;; WARN: new jak 2 until loop case, check carefully
|
||||
(defbehavior plat-code base-plat ()
|
||||
"After calling [[transform-post]] for 2 consecutive frames, put the process to sleep if it's not bouncing
|
||||
otherwise, continue bouncing...forever!
|
||||
@see [[transform-post]]"
|
||||
otherwise, continue bouncing...forever!
|
||||
@see [[transform-post]]"
|
||||
(transform-post)
|
||||
(suspend)
|
||||
(transform-post)
|
||||
@@ -105,9 +105,9 @@ otherwise, continue bouncing...forever!
|
||||
;; INFO: Used lq/sq
|
||||
(defbehavior plat-trans base-plat ()
|
||||
"If the platform is `bouncing`, move the platform accordingly with the [[smush-control]]
|
||||
- If the amplitude of the `smush` has hit `0.0` then stop bouncing
|
||||
|
||||
If we aren't bouncing however, TODO - CSHAPE"
|
||||
- If the amplitude of the `smush` has hit `0.0` then stop bouncing
|
||||
|
||||
If we aren't bouncing however, TODO - CSHAPE"
|
||||
(rider-trans)
|
||||
(cond
|
||||
((-> self bouncing)
|
||||
@@ -160,7 +160,7 @@ If we aren't bouncing however, TODO - CSHAPE"
|
||||
;; WARN: Return type mismatch none vs object.
|
||||
(defbehavior plat-event base-plat ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
|
||||
"Handles platform related events. Presently all this does is:
|
||||
- if `event-type` is [['bonk]], then call [[base-plat:29]]"
|
||||
- if `event-type` is [['bonk]], then call [[base-plat:29]]"
|
||||
(case event-type
|
||||
(('bonk)
|
||||
(start-bouncing! self)
|
||||
@@ -226,9 +226,9 @@ If we aren't bouncing however, TODO - CSHAPE"
|
||||
;; WARN: Return type mismatch symbol vs object.
|
||||
(defbehavior eco-door-event-handler eco-door ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
|
||||
"If the `event-type` is `'trigger`, flip the `locked` flag on the door
|
||||
and play the respective sound
|
||||
|
||||
@unused - likely a leftover from Jak 1"
|
||||
and play the respective sound
|
||||
|
||||
@unused - likely a leftover from Jak 1"
|
||||
(case event-type
|
||||
(('trigger)
|
||||
(set! (-> self locked) (not (-> self locked)))
|
||||
@@ -380,7 +380,7 @@ eco-door-event-handler
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod lock-according-to-task! ((this eco-door))
|
||||
"If the associated subtask is completed, lock the door if [[eco-door-flags:0]] is set
|
||||
otherwise, lock it if [[eco-door-flags:0]] is set"
|
||||
otherwise, lock it if [[eco-door-flags:0]] is set"
|
||||
(when (-> this state-actor)
|
||||
(if (logtest? (-> this state-actor extra perm status) (entity-perm-status subtask-complete))
|
||||
(set! (-> this locked) (logtest? (-> this flags) (eco-door-flags ecdf01)))
|
||||
@@ -427,11 +427,11 @@ otherwise, lock it if [[eco-door-flags:0]] is set"
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this eco-door) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(eco-door-method-25 this)
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(let ((door-scale (res-lump-float (-> this entity) 'scale :default 1.0)))
|
||||
|
||||
+8
-8
@@ -291,9 +291,9 @@
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod send-event! ((this basebutton) (event-type symbol))
|
||||
"Prepares an [[event-message-block]] using the provided type to send an event to:
|
||||
- the `notify-actor`
|
||||
- every [[entity-actor]] in the `actor-group` array
|
||||
@see [[entity-actor]]"
|
||||
- the `notify-actor`
|
||||
- every [[entity-actor]] in the `actor-group` array
|
||||
@see [[entity-actor]]"
|
||||
(when event-type
|
||||
(let ((event (new 'stack-no-clear 'event-message-block)))
|
||||
(set! (-> event from) (process->ppointer self))
|
||||
@@ -427,11 +427,11 @@
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this basebutton) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(local-vars (sv-16 res-tag))
|
||||
(reset! this)
|
||||
(set! (-> this button-id) -1)
|
||||
|
||||
+5
-5
@@ -175,11 +175,11 @@
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this blocking-plane) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(let ((s5-0 (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f))
|
||||
(f30-0 (res-lump-float (-> this entity) 'height :default 122880.0))
|
||||
)
|
||||
|
||||
+45
-45
@@ -1345,11 +1345,11 @@
|
||||
;; definition for method 11 of type eco-yellow
|
||||
(defmethod init-from-entity! ((this eco-yellow) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(init-common this arg0 (pickup-type eco-yellow) (-> *FACT-bank* eco-single-inc))
|
||||
(none)
|
||||
)
|
||||
@@ -1375,11 +1375,11 @@ This commonly includes things such as:
|
||||
;; definition for method 11 of type eco-red
|
||||
(defmethod init-from-entity! ((this eco-red) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(init-common this arg0 (pickup-type eco-red) (-> *FACT-bank* eco-single-inc))
|
||||
(none)
|
||||
)
|
||||
@@ -1405,11 +1405,11 @@ This commonly includes things such as:
|
||||
;; definition for method 11 of type eco-blue
|
||||
(defmethod init-from-entity! ((this eco-blue) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(init-common this arg0 (pickup-type eco-blue) (-> *FACT-bank* eco-single-inc))
|
||||
(none)
|
||||
)
|
||||
@@ -1435,11 +1435,11 @@ This commonly includes things such as:
|
||||
;; definition for method 11 of type eco-green
|
||||
(defmethod init-from-entity! ((this eco-green) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(init-common this arg0 (pickup-type eco-green) (-> *FACT-bank* eco-single-inc))
|
||||
(none)
|
||||
)
|
||||
@@ -1465,11 +1465,11 @@ This commonly includes things such as:
|
||||
;; definition for method 11 of type health
|
||||
(defmethod init-from-entity! ((this health) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(init-common this arg0 (pickup-type health) (-> *FACT-bank* health-default-inc))
|
||||
(none)
|
||||
)
|
||||
@@ -1520,11 +1520,11 @@ This commonly includes things such as:
|
||||
;; definition for method 11 of type eco-pill
|
||||
(defmethod init-from-entity! ((this eco-pill) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(init-common this arg0 (pickup-type eco-pill-green) (-> *FACT-bank* health-small-inc))
|
||||
(none)
|
||||
)
|
||||
@@ -1749,11 +1749,11 @@ This commonly includes things such as:
|
||||
;; definition for method 11 of type money
|
||||
(defmethod init-from-entity! ((this money) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(initialize-allocations this)
|
||||
(process-drawable-from-entity! this (-> this entity))
|
||||
(initialize-options this 0 1024.0 (the-as fact-info #f))
|
||||
@@ -2393,11 +2393,11 @@ This commonly includes things such as:
|
||||
;; definition for method 11 of type trick-point
|
||||
(defmethod init-from-entity! ((this trick-point) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(initialize-allocations this)
|
||||
(process-drawable-from-entity! this (-> this entity))
|
||||
(initialize-options this 0 1024.0 (the-as fact-info #f))
|
||||
@@ -2713,11 +2713,11 @@ This commonly includes things such as:
|
||||
;; definition for method 11 of type eco
|
||||
(defmethod init-from-entity! ((this eco) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(let ((v1-1 (res-lump-value (-> this entity) 'eco-info uint128 :time -1000000000.0)))
|
||||
(set! (-> this type) (cond
|
||||
((= (the-as uint v1-1) 3)
|
||||
|
||||
+6
-6
@@ -145,7 +145,7 @@
|
||||
;; WARN: Return type mismatch object vs ambient-sound.
|
||||
(defmethod set-and-get-ambient-sound! ((this conveyor))
|
||||
"So long as [[actor-option::16]] is not set, fetch the [[ambient-sound]] for the [[conveyor]]
|
||||
and return it as well. Otherwise, set it to `0`"
|
||||
and return it as well. Otherwise, set it to `0`"
|
||||
(let ((actor-options (res-lump-value (-> this entity) 'options actor-option :time -1000000000.0)))
|
||||
(the-as
|
||||
ambient-sound
|
||||
@@ -429,11 +429,11 @@ and return it as well. Otherwise, set it to `0`"
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this conveyor) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(reset-root! this)
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(initialize-skeleton this (the-as skeleton-group (get-art-group this)) (the-as pair 0))
|
||||
|
||||
+5
-9
@@ -1168,11 +1168,11 @@
|
||||
;; definition for method 11 of type crate
|
||||
(defmethod init-from-entity! ((this crate) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(crate-init! this arg0)
|
||||
(skel-init! this)
|
||||
(crate-method-38 this)
|
||||
@@ -1471,7 +1471,3 @@ This commonly includes things such as:
|
||||
#f
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+29
-29
@@ -136,10 +136,10 @@
|
||||
;; definition for method 43 of type elevator
|
||||
(defmethod move-between-points ((this elevator) (arg0 vector) (arg1 float) (arg2 float))
|
||||
"Move between two points on the elevator's path
|
||||
@param vec TODO not sure
|
||||
@param point-a The first point fetched from the elevator's path
|
||||
@param point-b The second point fetched from the path
|
||||
@see [[path-control]] and [[elevator]]"
|
||||
@param vec TODO not sure
|
||||
@param point-a The first point fetched from the elevator's path
|
||||
@param point-b The second point fetched from the path
|
||||
@see [[path-control]] and [[elevator]]"
|
||||
#f
|
||||
)
|
||||
|
||||
@@ -183,11 +183,11 @@
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod init-defaults! ((this elevator))
|
||||
"Initializes default settings related to the [[elevator]]:
|
||||
- `elevator-xz-threshold`
|
||||
- `elevator-y-threshold`
|
||||
- `elevator-start-pos`
|
||||
- `elevator-move-rate`
|
||||
- `elevator-flags`"
|
||||
- `elevator-xz-threshold`
|
||||
- `elevator-y-threshold`
|
||||
- `elevator-start-pos`
|
||||
- `elevator-move-rate`
|
||||
- `elevator-flags`"
|
||||
(let ((entity (-> this entity)))
|
||||
(set! (-> this params xz-threshold) ((method-of-object entity get-property-value-float)
|
||||
entity
|
||||
@@ -252,8 +252,8 @@
|
||||
;; definition for function ease-value-in-out
|
||||
(defun ease-value-in-out ((value float) (step-amount float))
|
||||
"TODO - the math in this function is full of duplication and isn't totally clear
|
||||
but if the name is to be believed, it's to slow a values grow at the beginning and end of it's range
|
||||
which is obviously useful for an elevator."
|
||||
but if the name is to be believed, it's to slow a values grow at the beginning and end of it's range
|
||||
which is obviously useful for an elevator."
|
||||
(let* ((step step-amount)
|
||||
(f4-0 (- 1.0 step-amount))
|
||||
(f3-0 (/ step (- 1.0 f4-0)))
|
||||
@@ -421,13 +421,13 @@ which is obviously useful for an elevator."
|
||||
;; INFO: Used lq/sq
|
||||
(defmethod find-closest-point-in-path! ((this elevator) (arg0 vector) (arg1 (pointer float)) (arg2 symbol) (arg3 symbol))
|
||||
"Finds and sets the provided [[path-step]]'s `next-pos` field to the vertex index in the path which is closest to
|
||||
the provided [[vector]]
|
||||
|
||||
@param vec The point at which distance calculations are based off
|
||||
@param! next-step If a point is found, `next-pos` will be set to the correct point
|
||||
@param arg2 TODO
|
||||
@param arg3 TODO
|
||||
@returns [[#t]] if a point in the path was found"
|
||||
the provided [[vector]]
|
||||
|
||||
@param vec The point at which distance calculations are based off
|
||||
@param! next-step If a point is found, `next-pos` will be set to the correct point
|
||||
@param arg2 TODO
|
||||
@param arg3 TODO
|
||||
@returns [[#t]] if a point in the path was found"
|
||||
(local-vars (path-point vector))
|
||||
(let ((elev-params (-> this params))
|
||||
(smallest-dist 0.0)
|
||||
@@ -494,8 +494,8 @@ the provided [[vector]]
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod move-to-next-point! ((this elevator))
|
||||
"If the [[*target*]] is in a valid state and there is a point to transition to in the elevator's path
|
||||
do so.
|
||||
@see [[elevator::47]]"
|
||||
do so.
|
||||
@see [[elevator::47]]"
|
||||
(local-vars (zero float))
|
||||
(let ((target *target*))
|
||||
(when (and target
|
||||
@@ -765,9 +765,9 @@ do so.
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod calc-dist-between-points! ((this elevator) (path-point-x int) (path-point-y int))
|
||||
"Calculates the distance between two points in the elevator's path.
|
||||
|
||||
@param path-point-x The index of the first point in the distance calculation, and where `next-pos` and `dist` are stored in the `path-seq` array
|
||||
@param path-point-y The second point in the distance calculation"
|
||||
|
||||
@param path-point-x The index of the first point in the distance calculation, and where `next-pos` and `dist` are stored in the `path-seq` array
|
||||
@param path-point-y The second point in the distance calculation"
|
||||
(set! (-> this path-seq data path-point-x next-pos) (the float path-point-y))
|
||||
(let ((point-x (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) (the float path-point-x) 'interp))
|
||||
(point-y (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) (the float path-point-y) 'interp))
|
||||
@@ -791,7 +791,7 @@ do so.
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod init-plat! ((this elevator))
|
||||
"Does any necessary initial platform setup.
|
||||
For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound."
|
||||
For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound."
|
||||
0
|
||||
(none)
|
||||
)
|
||||
@@ -832,11 +832,11 @@ For example for an elevator pre-compute the distance between the first and last
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this elevator) (entity entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(local-vars (sv-32 float) (sv-36 path-control) (sv-40 target))
|
||||
(init-plat-collision! this)
|
||||
(process-drawable-from-entity! this entity)
|
||||
|
||||
+25
-25
@@ -242,11 +242,11 @@
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this swingpole) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
"Copy defaults from the entity."
|
||||
(stack-size-set! (-> this main-thread) 128)
|
||||
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player))))
|
||||
@@ -343,11 +343,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this process-hidden) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
"Copy defaults from the entity."
|
||||
(process-entity-status! this (entity-perm-status dead) #t)
|
||||
(go (method-of-object this die))
|
||||
@@ -2050,11 +2050,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this med-res-level) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(stack-size-set! (-> this main-thread) 128)
|
||||
(let ((s4-0 (res-lump-struct arg0 'art-name structure))
|
||||
(s3-0 (res-lump-struct (-> this entity) 'level structure))
|
||||
@@ -2137,11 +2137,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this part-spawner) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(local-vars (sv-16 string))
|
||||
(stack-size-set! (-> this main-thread) 128)
|
||||
(logior! (-> this mask) (process-mask ambient))
|
||||
@@ -2783,11 +2783,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this launcher) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(stack-size-set! (-> this main-thread) 128)
|
||||
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player))))
|
||||
(let ((v1-4 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0))))
|
||||
|
||||
+9
-9
@@ -74,7 +74,7 @@
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod init-plat! ((this plat))
|
||||
"Does any necessary initial platform setup.
|
||||
For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound."
|
||||
For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound."
|
||||
0
|
||||
(none)
|
||||
)
|
||||
@@ -89,9 +89,9 @@ For example for an elevator pre-compute the distance between the first and last
|
||||
;; definition for method 36 of type plat
|
||||
(defmethod plat-path-sync ((this plat))
|
||||
"If the `sync` period is greater than `0` then transition the state to [[plat::35]]
|
||||
otherwise, [[plat::34]]
|
||||
|
||||
@see [[sync-eased]]"
|
||||
otherwise, [[plat::34]]
|
||||
|
||||
@see [[sync-eased]]"
|
||||
(cond
|
||||
((logtest? (-> this path flags) (path-control-flag not-found))
|
||||
(go (method-of-object this plat-idle))
|
||||
@@ -166,11 +166,11 @@ otherwise, [[plat::34]]
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this plat) (entity entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(logior! (-> this mask) (process-mask platform))
|
||||
(init-plat-collision! this)
|
||||
(process-drawable-from-entity! this entity)
|
||||
|
||||
+3
-3
@@ -90,9 +90,9 @@
|
||||
;; definition for method 36 of type projectile
|
||||
(defmethod handle-proj-hit! ((this projectile) (arg0 process) (arg1 event-message-block))
|
||||
"When a projectile hits something, first deal damage via [[projectile::37]]
|
||||
and increment the projectiles hit count.
|
||||
|
||||
If we've met or exceeded the projectiles maximum allowed hits, switch to the [[projectile::impact]] state"
|
||||
and increment the projectiles hit count.
|
||||
|
||||
If we've met or exceeded the projectiles maximum allowed hits, switch to the [[projectile::impact]] state"
|
||||
(when (-> this attack-mode)
|
||||
(let ((a2-1 (-> arg1 param 0)))
|
||||
(when (deal-damage! this arg0 (the-as event-message-block a2-1))
|
||||
|
||||
+5
-5
@@ -551,11 +551,11 @@
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod init-from-entity! ((this rigid-body-platform) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(logior! (-> this mask) (process-mask platform))
|
||||
(allocate-and-init-cshape this)
|
||||
(process-drawable-from-entity! this arg0)
|
||||
|
||||
+5
-5
@@ -608,11 +608,11 @@
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this judge) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(setup-collision this)
|
||||
(init this)
|
||||
(process-drawable-from-entity! this arg0)
|
||||
|
||||
+5
-5
@@ -682,11 +682,11 @@
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this water-anim) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(water-anim-method-27 this)
|
||||
(reset-root! this)
|
||||
(water-anim-init! this)
|
||||
|
||||
+10
-10
@@ -174,9 +174,9 @@
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod clear-history-entries! ((this history))
|
||||
"Iterates through each [[history-elt]] in the `elt` dynamic array
|
||||
For each entry:
|
||||
- clear `timestamp`
|
||||
- clear `record-tag`"
|
||||
For each entry:
|
||||
- clear `timestamp`
|
||||
- clear `record-tag`"
|
||||
(set! (-> this alloc-index) 0)
|
||||
(countdown (v1-0 (-> this allocated-length))
|
||||
(let ((a1-3 (-> this elts v1-0)))
|
||||
@@ -199,10 +199,10 @@ For each entry:
|
||||
;; WARN: new jak 2 until loop case, check carefully
|
||||
(defmethod clear-record-tags! ((this history) (arg0 history-channel) (arg1 uint) (arg2 uint))
|
||||
"First grab the latest [[history-elt]] at `alloc-index`
|
||||
1. update it's `channel`, `record-id` and `owner` from the provided args
|
||||
2. - if it's `record-tag` is zero -- return it
|
||||
- otherwise, iterate through all `elts` until one is found that does not match it's `timestamp`
|
||||
- if not `0` out the `record-tag` for that elt and continue iteration"
|
||||
1. update it's `channel`, `record-id` and `owner` from the provided args
|
||||
2. - if it's `record-tag` is zero -- return it
|
||||
- otherwise, iterate through all `elts` until one is found that does not match it's `timestamp`
|
||||
- if not `0` out the `record-tag` for that elt and continue iteration"
|
||||
(let* ((t1-0 (-> this alloc-index))
|
||||
(v1-0 (-> this elts))
|
||||
(v0-0 (-> v1-0 t1-0))
|
||||
@@ -253,9 +253,9 @@ For each entry:
|
||||
;; definition for method 10 of type history-iterator
|
||||
(defmethod update-entries! ((this history-iterator))
|
||||
"Iterate through each [[history-elt]] in [[*history*]]
|
||||
- If we hit the end set `done?` to true
|
||||
- If the `timestamp` on the elt, minus the current framecounter exceeds `max-age`, we are also done, return #f
|
||||
- However if we find an elt who's `owner` matches the iterator's, break out early returning that `elt`"
|
||||
- If we hit the end set `done?` to true
|
||||
- If the `timestamp` on the elt, minus the current framecounter exceeds `max-age`, we are also done, return #f
|
||||
- However if we find an elt who's `owner` matches the iterator's, break out early returning that `elt`"
|
||||
(let ((v1-0 *history*)
|
||||
(a1-2 (-> *display* base-clock frame-counter))
|
||||
)
|
||||
|
||||
+8
-8
@@ -64,9 +64,9 @@
|
||||
;; definition for function mem-size
|
||||
(defun mem-size ((data basic) (inspect-usage? symbol) (arg2 int))
|
||||
"@param data The [[basic]] to call `mem-usage` on
|
||||
@param inspect-usage? Set to [[#t]] if `inspect` should be called on the resulting [[memory-usage-block]]
|
||||
@param arg2 TODO - unsure, some sort of bitfield
|
||||
@returns The total memory footprint of the provided [[basic]]"
|
||||
@param inspect-usage? Set to [[#t]] if `inspect` should be called on the resulting [[memory-usage-block]]
|
||||
@param arg2 TODO - unsure, some sort of bitfield
|
||||
@returns The total memory footprint of the provided [[basic]]"
|
||||
(let ((block (new 'stack 'memory-usage-block)))
|
||||
(mem-usage data block arg2)
|
||||
(if inspect-usage?
|
||||
@@ -79,11 +79,11 @@
|
||||
;; definition for method 14 of type level
|
||||
(defmethod compute-memory-usage! ((this level) (force? symbol))
|
||||
"Calculates the memory usage of the level, returns and stores the [[memory-usage-block]]
|
||||
in `mem-usage-block` as well as the total size in `mem-usage`
|
||||
|
||||
@param force? - Will re-compute the usage if set to [[#t]], even if `mem-usage` has been set to a non-zero value
|
||||
@returns The [[memory-usage-block]] representing the footprint of the level
|
||||
@see [[memory-usage-block::10]]"
|
||||
in `mem-usage-block` as well as the total size in `mem-usage`
|
||||
|
||||
@param force? - Will re-compute the usage if set to [[#t]], even if `mem-usage` has been set to a non-zero value
|
||||
@returns The [[memory-usage-block]] representing the footprint of the level
|
||||
@see [[memory-usage-block::10]]"
|
||||
(if (zero? (-> this mem-usage-block))
|
||||
(set! (-> this mem-usage-block) (new 'debug 'memory-usage-block))
|
||||
)
|
||||
|
||||
+8
-8
@@ -311,7 +311,7 @@
|
||||
;; definition for method 13 of type mysql-nav-graph
|
||||
(defmethod alloc-new-node! ((this mysql-nav-graph))
|
||||
"Allocates a new `[[mysql-nav-node]]`, if `node-array`'s `length` exceeds `3000` return `-1`
|
||||
otherwise, return the new size of the array"
|
||||
otherwise, return the new size of the array"
|
||||
(cond
|
||||
((>= (-> this node-array length) 3000)
|
||||
(format #t "mysql-nav-graph : nodes buffer too small, increase NAV_GRAPH_EDITOR_NODE_COUNT~%")
|
||||
@@ -336,7 +336,7 @@ otherwise, return the new size of the array"
|
||||
;; definition for method 14 of type mysql-nav-graph
|
||||
(defmethod alloc-new-edge! ((this mysql-nav-graph))
|
||||
"Allocates a new `[[mysql-nav-edge]]`, if `edge-array`'s `length` exceeds `5000` return `-1`
|
||||
otherwise, return the new size of the array"
|
||||
otherwise, return the new size of the array"
|
||||
(cond
|
||||
((>= (-> this edge-array length) 5000)
|
||||
(format #t "mysql-nav-graph : edges buffer too small, increase NAV_GRAPH_EDITOR_EDGE_COUNT~%")
|
||||
@@ -361,7 +361,7 @@ otherwise, return the new size of the array"
|
||||
;; definition for method 15 of type mysql-nav-graph
|
||||
(defmethod indexof-visnode ((this mysql-nav-graph) (edge-id int) (node-id int))
|
||||
"Returns the index in the `visnode-array` whom's [[mysql-nav-visnode]] has the provided `runtime-edge-id` and `runtime-node-id`
|
||||
if none exist, return `-1`"
|
||||
if none exist, return `-1`"
|
||||
(dotimes (v1-0 (-> this visnode-array length))
|
||||
(let ((a3-2 (-> this visnode-array data v1-0)))
|
||||
(if (and (= (-> a3-2 runtime-edge-id) edge-id) (= (-> a3-2 runtime-node-id) node-id))
|
||||
@@ -375,9 +375,9 @@ if none exist, return `-1`"
|
||||
;; definition for method 16 of type mysql-nav-graph
|
||||
(defmethod alloc-new-visnode! ((this mysql-nav-graph) (edge-id int) (node-id int))
|
||||
"Potentially allocates a new `[[mysql-nav-visnode]]`:
|
||||
- if `visnode-array`'s `length` exceeds `3000` return `-1`
|
||||
- otherwise, if the node already exists, TODO
|
||||
- if the node does not already exist, create it!"
|
||||
- if `visnode-array`'s `length` exceeds `3000` return `-1`
|
||||
- otherwise, if the node already exists, TODO
|
||||
- if the node does not already exist, create it!"
|
||||
(cond
|
||||
((>= (-> this visnode-array length) 3000)
|
||||
(format #t "mysql-nav-graph : visnodes buffer too small, increase NAV_GRAPH_EDITOR_VISNODE_COUNT~%")
|
||||
@@ -777,7 +777,7 @@ if none exist, return `-1`"
|
||||
;; definition for method 11 of type mysql-nav-graph
|
||||
(defmethod indexof-nav-node ((this mysql-nav-graph) (node-id int))
|
||||
"Iterate through the `node-array` and return the index for the first [[mysql-nav-node]] whom's `nav_node_id` matches the provided id
|
||||
returns `-1` if none is found"
|
||||
returns `-1` if none is found"
|
||||
(dotimes (v1-0 (-> this node-array length))
|
||||
(if (= node-id (-> (the-as mysql-nav-node (-> this node-array data v1-0)) nav_node_id))
|
||||
(return v1-0)
|
||||
@@ -789,7 +789,7 @@ returns `-1` if none is found"
|
||||
;; definition for method 12 of type mysql-nav-graph
|
||||
(defmethod indexof-nav-edge ((this mysql-nav-graph) (edge-id int))
|
||||
"Iterate through the `edge-array` and return the index for the first [[mysql-nav-edge]] whom's `nav_edge_id` matches the provided id
|
||||
returns `-1` if none is found"
|
||||
returns `-1` if none is found"
|
||||
(dotimes (v1-0 (-> this edge-array length))
|
||||
(if (= edge-id (-> (the-as mysql-nav-edge (-> this edge-array data v1-0)) nav_edge_id))
|
||||
(return v1-0)
|
||||
|
||||
+2
-2
@@ -30,8 +30,8 @@
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defun-debug sampler-start ()
|
||||
"Reset the [[timer-bank]] EE registers.
|
||||
- If [[*sampler-mem*]] is undefined, allocate 16.7MB in the debug segment
|
||||
- and when [[*sampler-mem*]] is defined, initialize the [[timer-bank]] fully. Reset [[*sampler-count*]] to 0 as well"
|
||||
- If [[*sampler-mem*]] is undefined, allocate 16.7MB in the debug segment
|
||||
- and when [[*sampler-mem*]] is defined, initialize the [[timer-bank]] fully. Reset [[*sampler-count*]] to 0 as well"
|
||||
(set! (-> (the-as timer-bank #x10000000) mode) (new 'static 'timer-mode))
|
||||
(set! (-> (the-as timer-bank #x10000000) count) (the-as uint 0))
|
||||
(set! (-> (the-as timer-bank #x10000000) comp) *sampler-compare*)
|
||||
|
||||
+5
-5
@@ -218,11 +218,11 @@
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this viewer) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(set! *viewer* this)
|
||||
(set! (-> this root) (new 'process 'trsqv))
|
||||
(process-drawable-from-entity! this arg0)
|
||||
|
||||
+3
-3
@@ -513,9 +513,9 @@
|
||||
;; INFO: Used lq/sq
|
||||
(defun disasm-dma-list ((arg0 dma-packet) (arg1 symbol) (arg2 symbol) (arg3 symbol) (arg4 int))
|
||||
"Print out an entire DMA list.
|
||||
If mode is #t, print vif tags too. If mode is 'details, also print data unpacked by vif-tags.
|
||||
If verbose is #t, print out the addresses of each tag, and total size statistics.
|
||||
If expected size is negative, it is ignored. Otherwise, only disassemble this much dma data."
|
||||
If mode is #t, print vif tags too. If mode is 'details, also print data unpacked by vif-tags.
|
||||
If verbose is #t, print out the addresses of each tag, and total size statistics.
|
||||
If expected size is negative, it is ignored. Otherwise, only disassemble this much dma data."
|
||||
(local-vars
|
||||
(sv-16 object)
|
||||
(sv-32 dma-packet)
|
||||
|
||||
+4
-4
@@ -218,10 +218,10 @@
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod collect-regions ((this drawable) (arg0 sphere) (arg1 int) (arg2 region-prim-list))
|
||||
"Determines the number of [[drawable]]s in the `obj` that overlap the given `area-of-interest` this number is stored in the `region-list`'s item count
|
||||
@param area-of-interest The area defined by a sphere that we care about overlaps
|
||||
@param _count The amount of [[drawable]]s in the object to enumerate through
|
||||
@param! region-list Stores the overlapping regions and a count for how many were found
|
||||
@returns none"
|
||||
@param area-of-interest The area defined by a sphere that we care about overlaps
|
||||
@param _count The amount of [[drawable]]s in the object to enumerate through
|
||||
@param! region-list Stores the overlapping regions and a count for how many were found
|
||||
@returns none"
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
+6
-6
@@ -26,7 +26,7 @@
|
||||
;; INFO: Used lq/sq
|
||||
(defun entity-actor-count ((arg0 res-lump) (arg1 symbol))
|
||||
"Get the number of entities that this res references under the name.
|
||||
This works on more than just next/prev."
|
||||
This works on more than just next/prev."
|
||||
(local-vars (sv-16 res-tag))
|
||||
(set! sv-16 (new 'static 'res-tag))
|
||||
(if (res-lump-data arg0 arg1 pointer :tag-ptr (& sv-16))
|
||||
@@ -95,8 +95,8 @@ and use it for entity lookups."
|
||||
;; definition for method 0 of type actor-link-info
|
||||
(defmethod new actor-link-info ((allocation symbol) (type-to-make type) (arg0 process) (arg1 symbol))
|
||||
"Set up an actor-link-info for the given process.
|
||||
The entity of this process should be the entity-actor
|
||||
that will get this actor-link-info."
|
||||
The entity of this process should be the entity-actor
|
||||
that will get this actor-link-info."
|
||||
(let* ((a0-1 (-> arg0 entity))
|
||||
(s4-0 (entity-actor-lookup a0-1 'next-actor 0))
|
||||
(a0-2 (-> arg0 entity))
|
||||
@@ -152,7 +152,7 @@ that will get this actor-link-info."
|
||||
;; definition for method 16 of type actor-link-info
|
||||
(defmethod apply-function-forward ((this actor-link-info) (arg0 (function entity-actor object object)) (arg1 object))
|
||||
"Iterate forward through actors, and apply this function. Starts at (-> this next)
|
||||
If the function returns truthy, stop iterating."
|
||||
If the function returns truthy, stop iterating."
|
||||
(let ((s3-0 (-> this next)))
|
||||
(while s3-0
|
||||
(if (arg0 s3-0 arg1)
|
||||
@@ -167,7 +167,7 @@ If the function returns truthy, stop iterating."
|
||||
;; definition for method 17 of type actor-link-info
|
||||
(defmethod apply-function-reverse ((this actor-link-info) (arg0 (function entity-actor object object)) (arg1 object))
|
||||
"Iterate backward through actors and apply function.
|
||||
If the function returns truth, stop iterating."
|
||||
If the function returns truth, stop iterating."
|
||||
(let ((s3-0 (-> this prev)))
|
||||
(while s3-0
|
||||
(if (arg0 s3-0 arg1)
|
||||
@@ -323,7 +323,7 @@ If the function returns truth, stop iterating."
|
||||
;; definition for method 9 of type actor-link-info
|
||||
(defmethod get-matching-actor-type-mask ((this actor-link-info) (arg0 type))
|
||||
"Iterate through _all_ actors that are part of this actor list.
|
||||
If the nth actor is type matching-type, then set the nth bit of the result."
|
||||
If the nth actor is type matching-type, then set the nth bit of the result."
|
||||
(let ((s3-0 (-> this process entity))
|
||||
(s5-0 0)
|
||||
)
|
||||
|
||||
+4
-4
@@ -192,10 +192,10 @@
|
||||
;; WARN: Return type mismatch basic vs entity-info.
|
||||
(defun entity-info-lookup ((arg0 type))
|
||||
"Given a type, return the [[entity-info]] from [[*entity-info*]] whos type
|
||||
matches the `ptype` field. Set's `method 13` on said type that returns the `length`
|
||||
off the [[entity-info]]
|
||||
|
||||
If nothing matches, set `method 13` to `#f` and return `#f`"
|
||||
matches the `ptype` field. Set's `method 13` on said type that returns the `length`
|
||||
off the [[entity-info]]
|
||||
|
||||
If nothing matches, set `method 13` to `#f` and return `#f`"
|
||||
(the-as entity-info (cond
|
||||
((nonzero? (-> arg0 method-table 13))
|
||||
(-> arg0 method-table 13)
|
||||
|
||||
+34
-34
@@ -116,16 +116,16 @@
|
||||
;; WARN: Return type mismatch int vs res-tag-pair.
|
||||
(defmethod lookup-tag-idx ((this res-lump) (arg0 symbol) (arg1 symbol) (arg2 float))
|
||||
"Look up the index of the tag containing with the given name and timestamp.
|
||||
Correct lookups return a res-tag-pair, which contains one tag index in the lower 32 bits and one in the upper 32 bits.
|
||||
Depending on the mode, they may be the same, or they may be two tags that you should interpolate
|
||||
between, if the exact time was not found.
|
||||
|
||||
@param name-sym should be the name of the thing you want.
|
||||
@param time is for the timestamp you want.
|
||||
If mode = 'base, then both the indices are the same and the timestamp is ignored.
|
||||
If mode = 'interp, then it tries to get closest below/closest above (or both the same, if exact match found).
|
||||
If mode = 'exact, then it requires an exact timestamp match and both indices are the same.
|
||||
If things go wrong, returns a negative number."
|
||||
Correct lookups return a res-tag-pair, which contains one tag index in the lower 32 bits and one in the upper 32 bits.
|
||||
Depending on the mode, they may be the same, or they may be two tags that you should interpolate
|
||||
between, if the exact time was not found.
|
||||
|
||||
@param name-sym should be the name of the thing you want.
|
||||
@param time is for the timestamp you want.
|
||||
If mode = 'base, then both the indices are the same and the timestamp is ignored.
|
||||
If mode = 'interp, then it tries to get closest below/closest above (or both the same, if exact match found).
|
||||
If mode = 'exact, then it requires an exact timestamp match and both indices are the same.
|
||||
If things go wrong, returns a negative number."
|
||||
(local-vars (t4-1 int))
|
||||
(when (or (= arg0 'id)
|
||||
(= arg0 'aid)
|
||||
@@ -227,9 +227,9 @@ If things go wrong, returns a negative number."
|
||||
;; INFO: Used lq/sq
|
||||
(defmethod make-property-data ((this res-lump) (arg1 float) (tag-pair res-tag-pair) (arg3 pointer))
|
||||
"Returns (a pointer to) the value data of a property with the tag-pair.
|
||||
If tag-pair does not represent an exact point in the timeline, then the data is interpolated based on time
|
||||
with the result written into buf. buf must have enough space to copy all of the data.
|
||||
Otherwise, simply returns an address to the resource binary."
|
||||
If tag-pair does not represent an exact point in the timeline, then the data is interpolated based on time
|
||||
with the result written into buf. buf must have enough space to copy all of the data.
|
||||
Otherwise, simply returns an address to the resource binary."
|
||||
(rlet ((vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
(vf3 :class vf)
|
||||
@@ -420,10 +420,10 @@ Otherwise, simply returns an address to the resource binary."
|
||||
(arg5 pointer)
|
||||
)
|
||||
"Returns an address to a given property's data at a specific time stamp, or default on error.
|
||||
@param name is the name of the property you want, mode is its lookup mode ('interp 'base 'exact), time is the timestamp.
|
||||
@param default is the default result returned in the case of an error.
|
||||
@param tag-addr is an address to a res-tag. The current base tag is written to this. Ignored if tag-addr is #f
|
||||
@param buf-addr is an address to the data buffer used to write interpolated data to. It must have enough space! Only necessary for 'interp mode."
|
||||
@param name is the name of the property you want, mode is its lookup mode ('interp 'base 'exact), time is the timestamp.
|
||||
@param default is the default result returned in the case of an error.
|
||||
@param tag-addr is an address to a res-tag. The current base tag is written to this. Ignored if tag-addr is #f
|
||||
@param buf-addr is an address to the data buffer used to write interpolated data to. It must have enough space! Only necessary for 'interp mode."
|
||||
(let ((s3-0 (lookup-tag-idx this arg0 arg1 arg2)))
|
||||
(cond
|
||||
((< (the-as int s3-0) 0)
|
||||
@@ -452,11 +452,11 @@ Otherwise, simply returns an address to the resource binary."
|
||||
(arg5 pointer)
|
||||
)
|
||||
"Returns a given struct property's value at a specific time stamp, or default on error.
|
||||
@param name is the name of the property you want, `mode` is its lookup mode ('interp 'base 'exact), `time` is the timestamp.
|
||||
@param default is the default result returned in the case of an error.
|
||||
@param tag-addr is an address to a [[res-tag]]. The current base tag is written to this. Ignored if tag-addr is #f.
|
||||
@param buf-addr is an address to the data buffer used to write interpolated data to.
|
||||
It must have enough space! Only necessary for 'interp mode."
|
||||
@param name is the name of the property you want, `mode` is its lookup mode ('interp 'base 'exact), `time` is the timestamp.
|
||||
@param default is the default result returned in the case of an error.
|
||||
@param tag-addr is an address to a [[res-tag]]. The current base tag is written to this. Ignored if tag-addr is #f.
|
||||
@param buf-addr is an address to the data buffer used to write interpolated data to.
|
||||
It must have enough space! Only necessary for 'interp mode."
|
||||
(let ((s3-0 (lookup-tag-idx this arg0 arg1 arg2)))
|
||||
(cond
|
||||
((< (the-as int s3-0) 0)
|
||||
@@ -491,11 +491,11 @@ It must have enough space! Only necessary for 'interp mode."
|
||||
(arg5 pointer)
|
||||
)
|
||||
"Returns a given value property's value at a specific time stamp, or default on error.
|
||||
@param name is the name of the property you want, `mode` is its lookup mode ('interp 'base 'exact), `time` is the timestamp.
|
||||
@param default is the default result returned in the case of an error.
|
||||
@param tag-addr is an address to a res-tag. The current base tag is written to this. Ignored if `tag-addr` is #f.
|
||||
@param buf-addr is an address to the data buffer used to write interpolated data to.
|
||||
It must have enough space! Only necessary for 'interp mode."
|
||||
@param name is the name of the property you want, `mode` is its lookup mode ('interp 'base 'exact), `time` is the timestamp.
|
||||
@param default is the default result returned in the case of an error.
|
||||
@param tag-addr is an address to a res-tag. The current base tag is written to this. Ignored if `tag-addr` is #f.
|
||||
@param buf-addr is an address to the data buffer used to write interpolated data to.
|
||||
It must have enough space! Only necessary for 'interp mode."
|
||||
(let ((a2-1 (lookup-tag-idx this arg0 arg1 arg2)))
|
||||
(cond
|
||||
((< (the-as int a2-1) 0)
|
||||
@@ -677,10 +677,10 @@ It must have enough space! Only necessary for 'interp mode."
|
||||
;; INFO: Used lq/sq
|
||||
(defmethod allocate-data-memory-for-tag! ((this res-lump) (arg0 res-tag))
|
||||
"Find space for the data described by arg0 in this.
|
||||
Returns a tag with data-offset set correctly for this res-lump.
|
||||
If the lump already contains memory for the given tag, and it is big enough,
|
||||
it will be reused. Alignment will be at least 8 bytes.
|
||||
If the input tag has elt-count = 0, it will return a tag for elt-count = 1."
|
||||
Returns a tag with data-offset set correctly for this res-lump.
|
||||
If the lump already contains memory for the given tag, and it is big enough,
|
||||
it will be reused. Alignment will be at least 8 bytes.
|
||||
If the input tag has elt-count = 0, it will return a tag for elt-count = 1."
|
||||
(local-vars (resource-mem pointer))
|
||||
(let* ((tag-pair (lookup-tag-idx this (-> arg0 name) 'exact (-> arg0 key-frame)))
|
||||
(existing-tag (-> this tag (-> tag-pair lo)))
|
||||
@@ -746,8 +746,8 @@ If the input tag has elt-count = 0, it will return a tag for elt-count = 1."
|
||||
;; definition for method 17 of type res-lump
|
||||
(defmethod add-data! ((this res-lump) (tag res-tag) (arg2 pointer))
|
||||
"Given a tag and a pointer to its data, copy it to this res-lump.
|
||||
This doesn't seem to do the right thing if the given tag is a non-inline tag
|
||||
with > 1 element."
|
||||
This doesn't seem to do the right thing if the given tag is a non-inline tag
|
||||
with > 1 element."
|
||||
(let ((a0-2 (allocate-data-memory-for-tag! this tag)))
|
||||
(when a0-2
|
||||
(let* ((v1-2 this)
|
||||
@@ -787,7 +787,7 @@ with > 1 element."
|
||||
;; INFO: Used lq/sq
|
||||
(defmethod get-curve-data! ((this res-lump) (arg0 curve) (arg1 symbol) (arg2 symbol) (arg3 float))
|
||||
"Read curve data and write it to curve-target. Return #t if both
|
||||
control points and knots data was succesfully read, #f otherwise."
|
||||
control points and knots data was succesfully read, #f otherwise."
|
||||
(local-vars (sv-16 res-tag) (sv-32 res-tag))
|
||||
(let ((s5-0 #f))
|
||||
(set! sv-16 (new 'static 'res-tag))
|
||||
|
||||
+1
-1
@@ -249,7 +249,7 @@
|
||||
;; WARN: disable def twice: 23. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare.
|
||||
(defmethod intersects-line-segment? ((this bounding-box) (arg0 vector) (arg1 vector))
|
||||
"Check intersection in xz plane, using liang-barsky. Not sure if this actually
|
||||
a useful check or not..."
|
||||
a useful check or not..."
|
||||
(let ((f28-0 (- (-> arg1 x) (-> arg0 x)))
|
||||
(f30-0 (- (-> arg1 z) (-> arg0 z)))
|
||||
)
|
||||
|
||||
+27
-27
@@ -4,7 +4,7 @@
|
||||
;; definition for function vector-flatten!
|
||||
(defun vector-flatten! ((arg0 vector) (arg1 vector) (arg2 vector))
|
||||
"Get the projection of src onto a plane with the given normal
|
||||
The normal should have magnitude 1.0."
|
||||
The normal should have magnitude 1.0."
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
@@ -51,11 +51,11 @@ The normal should have magnitude 1.0."
|
||||
;; definition for function vector-reflect-flat!
|
||||
(defun vector-reflect-flat! ((arg0 vector) (arg1 vector) (arg2 vector))
|
||||
"This is a weird one. It doesn't care about the value of src dot normal
|
||||
and it effectively replaces the component of src normal to the plane with
|
||||
the plane's normal. I think this requires src/normal to both be unit vectors
|
||||
in order to make sense.
|
||||
NOTE: src should point from positive halfspace to negative otherwise it
|
||||
doesn't work."
|
||||
and it effectively replaces the component of src normal to the plane with
|
||||
the plane's normal. I think this requires src/normal to both be unit vectors
|
||||
in order to make sense.
|
||||
NOTE: src should point from positive halfspace to negative otherwise it
|
||||
doesn't work."
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
@@ -130,8 +130,8 @@ doesn't work."
|
||||
;; definition for function vector-segment-distance-point!
|
||||
(defun vector-segment-distance-point! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector))
|
||||
"Compute the distance from a point to the closest point on the line segment.
|
||||
arg0 is the point. arg1/arg2 are the endpoints of the line segment.
|
||||
arg3 is an optional output closest point."
|
||||
arg0 is the point. arg1/arg2 are the endpoints of the line segment.
|
||||
arg3 is an optional output closest point."
|
||||
(local-vars (v0-0 float) (v1-0 float) (v1-1 float))
|
||||
(rlet ((acc :class vf)
|
||||
(Q :class vf)
|
||||
@@ -204,7 +204,7 @@ arg3 is an optional output closest point."
|
||||
;; INFO: Used lq/sq
|
||||
(defun vector-line-distance ((arg0 vector) (arg1 vector) (arg2 vector))
|
||||
"Weird function: given a point arg1, and an infinite line connecting arg2 and arg1, compute the distance
|
||||
from arg0 to that line."
|
||||
from arg0 to that line."
|
||||
(let* ((a1-3 (vector-normalize! (vector-! (new-stack-vector0) arg2 arg1) 1.0))
|
||||
(gp-1 (vector-! (new-stack-vector0) arg0 arg1))
|
||||
(f0-1 (vector-dot a1-3 gp-1))
|
||||
@@ -405,7 +405,7 @@ from arg0 to that line."
|
||||
;; definition for function forward-up->inv-matrix
|
||||
(defun forward-up->inv-matrix ((arg0 matrix) (arg1 vector) (arg2 vector))
|
||||
"Create a matrix representing an inverse transform where arg1 is forward (+z)
|
||||
and arg2 is up (+y). Will use the pitch of forward."
|
||||
and arg2 is up (+y). Will use the pitch of forward."
|
||||
(forward-down->inv-matrix arg0 arg1 (vector-negate! (new 'stack-no-clear 'vector) arg2))
|
||||
)
|
||||
|
||||
@@ -413,7 +413,7 @@ and arg2 is up (+y). Will use the pitch of forward."
|
||||
;; INFO: Used lq/sq
|
||||
(defun forward-up-nopitch->inv-matrix ((arg0 matrix) (arg1 vector) (arg2 vector))
|
||||
"Create a matrix representing an inverse transform where arg1 is forward (+z)
|
||||
and arg2 is up (+y). Will not use the pitch of forward."
|
||||
and arg2 is up (+y). Will not use the pitch of forward."
|
||||
(forward-down-nopitch->inv-matrix arg0 arg1 (vector-negate! (new-stack-vector0) arg2))
|
||||
)
|
||||
|
||||
@@ -454,7 +454,7 @@ and arg2 is up (+y). Will not use the pitch of forward."
|
||||
;; INFO: Used lq/sq
|
||||
(defun quaternion-from-two-vectors-partial! ((arg0 quaternion) (arg1 vector) (arg2 vector) (arg3 float))
|
||||
"Create a quaternion representing the rotation between two vectors,
|
||||
doing arg3 fraction of the total rotation."
|
||||
doing arg3 fraction of the total rotation."
|
||||
(let* ((s5-0 (vector-cross! (new-stack-vector0) arg1 arg2))
|
||||
(f0-0 (vector-length s5-0))
|
||||
(f1-1 (+ 1.0 (* arg3 (+ -1.0 (vector-dot arg1 arg2)))))
|
||||
@@ -543,7 +543,7 @@ doing arg3 fraction of the total rotation."
|
||||
;; INFO: Used lq/sq
|
||||
(defun matrix-from-two-vectors-max-angle! ((arg0 matrix) (arg1 vector) (arg2 vector) (arg3 float))
|
||||
"Create a rotation matrix representing the rotation between two vectors,
|
||||
allowing at most a rotation of arg3 degrees."
|
||||
allowing at most a rotation of arg3 degrees."
|
||||
(let ((s4-1 (vector-normalize! (vector-cross! (new-stack-vector0) arg2 arg1) 1.0))
|
||||
(f30-0 (vector-dot arg1 arg2))
|
||||
(f28-0 (cos arg3))
|
||||
@@ -569,10 +569,10 @@ allowing at most a rotation of arg3 degrees."
|
||||
;; definition for function matrix-from-two-vectors-smooth!
|
||||
(defun matrix-from-two-vectors-smooth! ((arg0 matrix) (arg1 vector) (arg2 vector) (arg3 float) (arg4 int))
|
||||
"This function can help smoothly rotate from a current heading vector to a target one.
|
||||
It returns a rotation to move arg1 closer to arg2, subject to two different speed limits.
|
||||
arg3 is a rotations-per-frame rate. This limit takes frame rate into account (when lagging, the rotation is larger)
|
||||
arg4 is a 'slow down when getting close to the end' limit.
|
||||
This is used in rotate-toward-orientation, which is much improved from jak 1."
|
||||
It returns a rotation to move arg1 closer to arg2, subject to two different speed limits.
|
||||
arg3 is a rotations-per-frame rate. This limit takes frame rate into account (when lagging, the rotation is larger)
|
||||
arg4 is a 'slow down when getting close to the end' limit.
|
||||
This is used in rotate-toward-orientation, which is much improved from jak 1."
|
||||
(let* ((s5-1 (vector-normalize! (vector-cross! (new 'stack-no-clear 'vector) arg2 arg1) 1.0))
|
||||
(f0-1 (vector-dot arg1 arg2))
|
||||
(f0-2 (acos f0-1))
|
||||
@@ -587,7 +587,7 @@ This is used in rotate-toward-orientation, which is much improved from jak 1."
|
||||
;; definition for function matrix-from-two-vectors-the-long-way-smooth!
|
||||
(defun matrix-from-two-vectors-the-long-way-smooth! ((arg0 matrix) (arg1 vector) (arg2 vector) (arg3 float) (arg4 int))
|
||||
"Same as above, but rotates you away from the target.
|
||||
Note that the 'near the end' smoothing will apply when you're near the target."
|
||||
Note that the 'near the end' smoothing will apply when you're near the target."
|
||||
(let* ((s5-1 (vector-normalize! (vector-cross! (new 'stack-no-clear 'vector) arg2 arg1) 1.0))
|
||||
(f0-1 (vector-dot arg1 arg2))
|
||||
(f0-3 (- (acos f0-1)))
|
||||
@@ -610,7 +610,7 @@ Note that the 'near the end' smoothing will apply when you're near the target."
|
||||
;; definition for function matrix-from-two-vectors-max-angle-partial!
|
||||
(defun matrix-from-two-vectors-max-angle-partial! ((arg0 matrix) (arg1 vector) (arg2 vector) (arg3 float) (arg4 float))
|
||||
"Create a rotation matrix representing the given fraction of the rotation between two heading vectors,
|
||||
rotating by at most the given angle."
|
||||
rotating by at most the given angle."
|
||||
(let* ((s4-1 (vector-normalize! (vector-cross! (new 'stack-no-clear 'vector) arg2 arg1) 1.0))
|
||||
(f28-0 (vector-dot arg1 arg2))
|
||||
(f30-0 (cos arg3))
|
||||
@@ -1049,8 +1049,8 @@ rotating by at most the given angle."
|
||||
;; definition for function point-in-plane-<-point+normal!
|
||||
(defun point-in-plane-<-point+normal! ((arg0 vector) (arg1 vector) (arg2 vector))
|
||||
"Very strange function. Takes a plane, in point-normal form, then returns some other point on that plane.
|
||||
It will move 1m in two of {x, y, z} directions. The direction not moved in is the one which is closest to point-in-triangle-cross
|
||||
in the same direction of the normal (this prevent moving huge distances for nearly vertical planes for example)."
|
||||
It will move 1m in two of {x, y, z} directions. The direction not moved in is the one which is closest to point-in-triangle-cross
|
||||
in the same direction of the normal (this prevent moving huge distances for nearly vertical planes for example)."
|
||||
(let ((f0-3 (+ (* (-> arg2 x) (-> arg1 x)) (* (-> arg2 y) (-> arg1 y)) (* (-> arg2 z) (-> arg1 z)))))
|
||||
(set! (-> arg0 w) 1.0)
|
||||
(let ((f1-7 (fabs (-> arg2 x)))
|
||||
@@ -1509,12 +1509,12 @@ in the same direction of the normal (this prevent moving huge distances for near
|
||||
;; ERROR: Unsupported inline assembly instruction kind - [sll v1, v1, 4]
|
||||
(defun curve-evaluate! ((arg0 vector) (arg1 float) (arg2 (inline-array vector)) (arg3 int) (arg4 (pointer float)) (arg5 int))
|
||||
"Evaluate a curve.
|
||||
arg0 is the output
|
||||
arg1 is the input.
|
||||
arg2 is control vertices.
|
||||
arg3 is the number of control vertices.
|
||||
arg4 is the knot points.
|
||||
arg5 is the number of knots."
|
||||
arg0 is the output
|
||||
arg1 is the input.
|
||||
arg2 is control vertices.
|
||||
arg3 is the number of control vertices.
|
||||
arg4 is the knot points.
|
||||
arg5 is the number of knots."
|
||||
(local-vars (v1-7 int) (v1-8 int) (v1-10 float) (s3-0 int))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
|
||||
+75
-75
@@ -73,8 +73,8 @@
|
||||
;; definition for method 18 of type curve-control
|
||||
(defmethod total-distance ((this curve-control))
|
||||
"Will lazily calculate and set the [[curve]]'s `length`
|
||||
@returns total path length of the [[curve]]
|
||||
@see [[curve-length]]"
|
||||
@returns total path length of the [[curve]]
|
||||
@see [[curve-length]]"
|
||||
(let ((f0-0 (-> this curve length)))
|
||||
(when (= f0-0 0.0)
|
||||
(set! f0-0 (curve-length (-> this curve)))
|
||||
@@ -88,16 +88,16 @@
|
||||
;; INFO: Used lq/sq
|
||||
(defmethod get-point-in-path! ((this path-control) (ret vector) (idx float) (search-type symbol))
|
||||
"Depending on the value of `idx`, the result can be quite different:
|
||||
- if `idx` is less than `0.0` - return the first vertex in the path
|
||||
- if `idx` is greater than the number of vertices in the path, return the last vertex
|
||||
- if `search-type` is equal to `exact` OR `idx` is an integral number (ex 1.0), return that vertex
|
||||
- otherwise, do a linear interpolation between the vertex at `idx` (truncated) and the next vertex
|
||||
using the fractional component of `idx` as the interpolant, return this result
|
||||
|
||||
@param! ret The [[vector]] that is used to hold the return value
|
||||
@param idx Either the vertex index or also partially the interpolant in a LERP
|
||||
@param search-type The only recognized value is `exact`
|
||||
@returns Either a distinct vertex along the path, or some fractional point between two vertices"
|
||||
- if `idx` is less than `0.0` - return the first vertex in the path
|
||||
- if `idx` is greater than the number of vertices in the path, return the last vertex
|
||||
- if `search-type` is equal to `exact` OR `idx` is an integral number (ex 1.0), return that vertex
|
||||
- otherwise, do a linear interpolation between the vertex at `idx` (truncated) and the next vertex
|
||||
using the fractional component of `idx` as the interpolant, return this result
|
||||
|
||||
@param! ret The [[vector]] that is used to hold the return value
|
||||
@param idx Either the vertex index or also partially the interpolant in a LERP
|
||||
@param search-type The only recognized value is `exact`
|
||||
@returns Either a distinct vertex along the path, or some fractional point between two vertices"
|
||||
(let ((num-vertices (-> this curve num-cverts))
|
||||
(vert-idx (the float (the int idx)))
|
||||
)
|
||||
@@ -148,20 +148,20 @@ using the fractional component of `idx` as the interpolant, return this result
|
||||
;; definition for method 14 of type path-control
|
||||
(defmethod get-point-at-percent-along-path! ((this path-control) (ret vector) (percent float) (search-type symbol))
|
||||
"@param! ret The [[vector]] that is used to hold the return value
|
||||
@param percent The percentage along the path
|
||||
@param search-type The only recognized value is `exact`
|
||||
@returns the point closest to some arbitrary percentage along the path
|
||||
@see [[path-control::10]]"
|
||||
@param percent The percentage along the path
|
||||
@param search-type The only recognized value is `exact`
|
||||
@returns the point closest to some arbitrary percentage along the path
|
||||
@see [[path-control::10]]"
|
||||
(get-point-in-path! this ret (* percent (the float (+ (-> this curve num-cverts) -1))) search-type)
|
||||
)
|
||||
|
||||
;; definition for method 14 of type curve-control
|
||||
(defmethod get-point-at-percent-along-path! ((this curve-control) (arg0 vector) (arg1 float) (arg2 symbol))
|
||||
"@param! ret The [[vector]] that is used to hold the return value
|
||||
@param percent The percentage along the path
|
||||
@param search-type The only recognized value is `exact`
|
||||
@returns the point closest to some arbitrary percentage along the path
|
||||
@see [[path-control::10]]"
|
||||
@param percent The percentage along the path
|
||||
@param search-type The only recognized value is `exact`
|
||||
@returns the point closest to some arbitrary percentage along the path
|
||||
@see [[path-control::10]]"
|
||||
(if (not (logtest? (-> this flags) (path-control-flag not-found)))
|
||||
(curve-evaluate!
|
||||
arg0
|
||||
@@ -178,16 +178,16 @@ using the fractional component of `idx` as the interpolant, return this result
|
||||
;; definition for method 10 of type curve-control
|
||||
(defmethod get-point-in-path! ((this curve-control) (arg0 vector) (arg1 float) (arg2 symbol))
|
||||
"Depending on the value of `idx`, the result can be quite different:
|
||||
- if `idx` is less than `0.0` - return the first vertex in the path
|
||||
- if `idx` is greater than the number of vertices in the path, return the last vertex
|
||||
- if `search-type` is equal to `exact` OR `idx` is an integral number (ex 1.0), return that vertex
|
||||
- otherwise, do a linear interpolation between the vertex at `idx` (truncated) and the next vertex
|
||||
using the fractional component of `idx` as the interpolant, return this result
|
||||
|
||||
@param! ret The [[vector]] that is used to hold the return value
|
||||
@param idx Either the vertex index or also partially the interpolant in a LERP
|
||||
@param search-type The only recognized value is `exact`
|
||||
@returns Either a distinct vertex along the path, or some fractional point between two vertices"
|
||||
- if `idx` is less than `0.0` - return the first vertex in the path
|
||||
- if `idx` is greater than the number of vertices in the path, return the last vertex
|
||||
- if `search-type` is equal to `exact` OR `idx` is an integral number (ex 1.0), return that vertex
|
||||
- otherwise, do a linear interpolation between the vertex at `idx` (truncated) and the next vertex
|
||||
using the fractional component of `idx` as the interpolant, return this result
|
||||
|
||||
@param! ret The [[vector]] that is used to hold the return value
|
||||
@param idx Either the vertex index or also partially the interpolant in a LERP
|
||||
@param search-type The only recognized value is `exact`
|
||||
@returns Either a distinct vertex along the path, or some fractional point between two vertices"
|
||||
(if (not (logtest? (-> this flags) (path-control-flag not-found)))
|
||||
(curve-evaluate!
|
||||
arg0
|
||||
@@ -204,15 +204,15 @@ using the fractional component of `idx` as the interpolant, return this result
|
||||
;; definition for method 26 of type path-control
|
||||
(defmethod displacement-between-two-points! ((this path-control) (ret vector) (idx float) (mag float))
|
||||
"Return value can differ quite a bit:
|
||||
- If [[path-control-flag::4]] is set OR there are less than 2 vertices OR `idx` is less than `0.0` - return [[*null-vector*]]
|
||||
- Otherwise, find the scaled (by `mag`) displacement vector between two points in the path:
|
||||
- If `idx` is not beyond the second last vertex, the result is between vertex `idx` and `idx+1`
|
||||
- else, the result is between the second last vertex and the last
|
||||
|
||||
@param! ret The [[vector]] that is used to hold the return value
|
||||
@param idx The vertex index
|
||||
@param mag The magnitude to scale the resulting displacement vector by
|
||||
@returns The displacement [[vector]] between two points in the path, the last 2, or the [[*null-vector*]]"
|
||||
- If [[path-control-flag::4]] is set OR there are less than 2 vertices OR `idx` is less than `0.0` - return [[*null-vector*]]
|
||||
- Otherwise, find the scaled (by `mag`) displacement vector between two points in the path:
|
||||
- If `idx` is not beyond the second last vertex, the result is between vertex `idx` and `idx+1`
|
||||
- else, the result is between the second last vertex and the last
|
||||
|
||||
@param! ret The [[vector]] that is used to hold the return value
|
||||
@param idx The vertex index
|
||||
@param mag The magnitude to scale the resulting displacement vector by
|
||||
@returns The displacement [[vector]] between two points in the path, the last 2, or the [[*null-vector*]]"
|
||||
(let ((num-vertices (-> this curve num-cverts))
|
||||
(vert-idx (the float (the int idx)))
|
||||
)
|
||||
@@ -234,17 +234,17 @@ using the fractional component of `idx` as the interpolant, return this result
|
||||
;; definition for method 12 of type path-control
|
||||
(defmethod displacement-between-two-points-copy! ((this path-control) (ret vector) (idx float) (mag float))
|
||||
"Calls [[path-control::26]] with the provided args
|
||||
@see [[path-control::26]]"
|
||||
@see [[path-control::26]]"
|
||||
(displacement-between-two-points! this ret idx mag)
|
||||
)
|
||||
|
||||
;; definition for method 15 of type path-control
|
||||
(defmethod displacement-between-points-at-percent-scaled! ((this path-control) (ret vector) (percent float) (mag float))
|
||||
"Calls [[path-control::12], with the `idx` at a given percent along the path
|
||||
@param ret The [[vector]] that is used to hold the return value
|
||||
@param percent The percentage along the path to find the first index
|
||||
@param mag Multiplied by the number of points in the path and scales the resulting vector
|
||||
@returns The displacement between the last two points of the path scaled to the magnitude equal to the number of points in the path"
|
||||
@param ret The [[vector]] that is used to hold the return value
|
||||
@param percent The percentage along the path to find the first index
|
||||
@param mag Multiplied by the number of points in the path and scales the resulting vector
|
||||
@returns The displacement between the last two points of the path scaled to the magnitude equal to the number of points in the path"
|
||||
(displacement-between-two-points-copy!
|
||||
this
|
||||
ret
|
||||
@@ -256,10 +256,10 @@ using the fractional component of `idx` as the interpolant, return this result
|
||||
;; definition for method 13 of type path-control
|
||||
(defmethod displacement-between-two-points-normalized! ((this path-control) (ret vector) (idx float))
|
||||
"Calls [[path-control::26], with the provided `idx`
|
||||
@param! ret The [[vector]] the result is stored within
|
||||
@param idx The vertex index
|
||||
@returns The resulting displacement vector, normalized
|
||||
@see [[path-control::26]]"
|
||||
@param! ret The [[vector]] the result is stored within
|
||||
@param idx The vertex index
|
||||
@returns The resulting displacement vector, normalized
|
||||
@see [[path-control::26]]"
|
||||
(displacement-between-two-points! this ret idx 1.0)
|
||||
(vector-normalize! ret 1.0)
|
||||
)
|
||||
@@ -267,11 +267,11 @@ using the fractional component of `idx` as the interpolant, return this result
|
||||
;; definition for method 16 of type path-control
|
||||
(defmethod displacement-between-points-at-percent-normalized! ((this path-control) (ret vector) (percent float))
|
||||
"Calls [[path-control::13], with the `idx` at a given percent along the path
|
||||
@param! ret The [[vector]] the result is stored within
|
||||
@param percent The percentage along the path
|
||||
@returns The resulting displacement vector, normalized
|
||||
@see [[path-control::13]]
|
||||
@see [[path-control::14]]"
|
||||
@param! ret The [[vector]] the result is stored within
|
||||
@param percent The percentage along the path
|
||||
@returns The resulting displacement vector, normalized
|
||||
@see [[path-control::13]]
|
||||
@see [[path-control::14]]"
|
||||
(displacement-between-two-points-normalized!
|
||||
this
|
||||
ret
|
||||
@@ -282,15 +282,15 @@ using the fractional component of `idx` as the interpolant, return this result
|
||||
;; definition for method 26 of type curve-control
|
||||
(defmethod displacement-between-two-points! ((this curve-control) (arg0 vector) (arg1 float) (arg2 float))
|
||||
"Return value can differ quite a bit:
|
||||
- If [[path-control-flag::4]] is set OR there are less than 2 vertices OR `idx` is less than `0.0` - return [[*null-vector*]]
|
||||
- Otherwise, find the scaled (by `mag`) displacement vector between two points in the path:
|
||||
- If `idx` is not beyond the second last vertex, the result is between vertex `idx` and `idx+1`
|
||||
- else, the result is between the second last vertex and the last
|
||||
|
||||
@param! ret The [[vector]] that is used to hold the return value
|
||||
@param idx The vertex index
|
||||
@param mag The magnitude to scale the resulting displacement vector by
|
||||
@returns The displacement [[vector]] between two points in the path, the last 2, or the [[*null-vector*]]"
|
||||
- If [[path-control-flag::4]] is set OR there are less than 2 vertices OR `idx` is less than `0.0` - return [[*null-vector*]]
|
||||
- Otherwise, find the scaled (by `mag`) displacement vector between two points in the path:
|
||||
- If `idx` is not beyond the second last vertex, the result is between vertex `idx` and `idx+1`
|
||||
- else, the result is between the second last vertex and the last
|
||||
|
||||
@param! ret The [[vector]] that is used to hold the return value
|
||||
@param idx The vertex index
|
||||
@param mag The magnitude to scale the resulting displacement vector by
|
||||
@returns The displacement [[vector]] between two points in the path, the last 2, or the [[*null-vector*]]"
|
||||
(when (not (logtest? (-> this flags) (path-control-flag not-found)))
|
||||
(let ((s4-0 (new 'stack-no-clear 'vector)))
|
||||
(curve-evaluate!
|
||||
@@ -338,21 +338,21 @@ using the fractional component of `idx` as the interpolant, return this result
|
||||
;; definition for method 15 of type curve-control
|
||||
(defmethod displacement-between-points-at-percent-scaled! ((this curve-control) (ret vector) (idx float) (mag float))
|
||||
"Calls [[path-control::12], with the `idx` at a given percent along the path
|
||||
@param ret The [[vector]] that is used to hold the return value
|
||||
@param percent The percentage along the path to find the first index
|
||||
@param mag Multiplied by the number of points in the path and scales the resulting vector
|
||||
@returns The displacement between the last two points of the path scaled to the magnitude equal to the number of points in the path"
|
||||
@param ret The [[vector]] that is used to hold the return value
|
||||
@param percent The percentage along the path to find the first index
|
||||
@param mag Multiplied by the number of points in the path and scales the resulting vector
|
||||
@returns The displacement between the last two points of the path scaled to the magnitude equal to the number of points in the path"
|
||||
(displacement-between-two-points! this ret idx mag)
|
||||
)
|
||||
|
||||
;; definition for method 16 of type curve-control
|
||||
(defmethod displacement-between-points-at-percent-normalized! ((this curve-control) (ret vector) (percent float))
|
||||
"Calls [[path-control::13], with the `idx` at a given percent along the path
|
||||
@param! ret The [[vector]] the result is stored within
|
||||
@param percent The percentage along the path
|
||||
@returns The resulting displacement vector, normalized
|
||||
@see [[path-control::13]]
|
||||
@see [[path-control::14]]"
|
||||
@param! ret The [[vector]] the result is stored within
|
||||
@param percent The percentage along the path
|
||||
@returns The resulting displacement vector, normalized
|
||||
@see [[path-control::13]]
|
||||
@see [[path-control::14]]"
|
||||
(displacement-between-two-points! this ret percent 0.01)
|
||||
(vector-normalize! ret 1.0)
|
||||
)
|
||||
@@ -371,8 +371,8 @@ using the fractional component of `idx` as the interpolant, return this result
|
||||
;; INFO: Used lq/sq
|
||||
(defmethod get-furthest-point-on-path ((this path-control) (point vector))
|
||||
"@param point The point to calculate distance from
|
||||
@returns the `vertex-idx.interpolant` value to the point on the path furthest away from the `point`
|
||||
@see [[path-control::10]]"
|
||||
@returns the `vertex-idx.interpolant` value to the point on the path furthest away from the `point`
|
||||
@see [[path-control::10]]"
|
||||
(let ((curr-point (new 'stack-no-clear 'vector))
|
||||
(next-point (new 'stack-no-clear 'vector))
|
||||
(given-point (new 'stack-no-clear 'vector))
|
||||
@@ -407,8 +407,8 @@ using the fractional component of `idx` as the interpolant, return this result
|
||||
;; definition for method 23 of type path-control
|
||||
(defmethod get-path-percentage-at-furthest-point ((this path-control) (point vector))
|
||||
"@param point The point to calculate distance from
|
||||
@returns the percentage of path completion from the point on the path furthest away from the `point`
|
||||
@see [[path-control::14]]"
|
||||
@returns the percentage of path completion from the point on the path furthest away from the `point`
|
||||
@see [[path-control::14]]"
|
||||
(/ (get-furthest-point-on-path this point) (the float (+ (-> this curve num-cverts) -1)))
|
||||
)
|
||||
|
||||
|
||||
+25
-25
@@ -7,11 +7,11 @@
|
||||
;; definition for function light-slerp
|
||||
(defun light-slerp ((light-out light) (light-a light) (light-b light) (alpha float))
|
||||
"Linearly interpolate between two [[light]]s
|
||||
@param! light-out The resultant
|
||||
@param light-a One of the two lights
|
||||
@param light-b One of the two lights
|
||||
@param alpha Clamped to between `0.0` and `1.0`
|
||||
@returns The interpolated [[light]]"
|
||||
@param! light-out The resultant
|
||||
@param light-a One of the two lights
|
||||
@param light-b One of the two lights
|
||||
@param alpha Clamped to between `0.0` and `1.0`
|
||||
@returns The interpolated [[light]]"
|
||||
(let ((clamped-alpha (fmax 0.0 (fmin 1.0 alpha))))
|
||||
(vector-lerp! (-> light-out color) (-> light-a color) (-> light-b color) clamped-alpha)
|
||||
(vector-deg-slerp (-> light-out direction) (-> light-a direction) (-> light-b direction) clamped-alpha)
|
||||
@@ -27,11 +27,11 @@
|
||||
;; definition for function light-group-slerp
|
||||
(defun light-group-slerp ((light-group-out light-group) (light-group-a light-group) (light-group-b light-group) (alpha float))
|
||||
"Linearly interpolate between two [[light-groups]]s by calling [[light-slerp]] on each respective collection of lights
|
||||
@param light-group-out The resultant
|
||||
@param light-group-a One of the two [[light-group]]s
|
||||
@param light-group-b One of the two [[light-group]]s
|
||||
@param alpha
|
||||
@returns The linearly interpolated [[light-group]]"
|
||||
@param light-group-out The resultant
|
||||
@param light-group-a One of the two [[light-group]]s
|
||||
@param light-group-b One of the two [[light-group]]s
|
||||
@param alpha
|
||||
@returns The linearly interpolated [[light-group]]"
|
||||
(dotimes (group-idx 4)
|
||||
(light-slerp
|
||||
(-> light-group-out lights group-idx)
|
||||
@@ -46,11 +46,11 @@
|
||||
;; definition for function light-group-process!
|
||||
(defun light-group-process! ((vu-lights vu-lights) (light-group light-group) (vec1 vector) (vec2 vector))
|
||||
"Unused, needlessly calls [[rotate-y<-vector+vector]] on the two [[vector]]s and calls [[vu-lights<-light-group!]]
|
||||
@param vu-lights
|
||||
@param light-group
|
||||
@param vec1
|
||||
@param vec2
|
||||
@returns [[none]]"
|
||||
@param vu-lights
|
||||
@param light-group
|
||||
@param vec1
|
||||
@param vec2
|
||||
@returns [[none]]"
|
||||
(rotate-y<-vector+vector vec2 vec1)
|
||||
(vu-lights<-light-group! vu-lights light-group)
|
||||
(none)
|
||||
@@ -62,8 +62,8 @@
|
||||
;; definition for function vu-lights-default!
|
||||
(defun vu-lights-default! ((lights vu-lights))
|
||||
"Setups up a default [[vu-lights]] instance
|
||||
@param! lights
|
||||
@returns [[vu-lights]]"
|
||||
@param! lights
|
||||
@returns [[vu-lights]]"
|
||||
(set-vector! (-> lights ambient) 0.3 0.3 0.3 1.0)
|
||||
(set-vector! (-> lights color 0) 1.0 1.0 1.0 1.0)
|
||||
(set-vector! (-> lights color 1) 0.2 0.2 0.2 1.0)
|
||||
@@ -78,10 +78,10 @@
|
||||
;; WARN: Return type mismatch pointer vs none.
|
||||
(defun-debug init-light-hash ()
|
||||
"Initializes the global [[*light-hash*]].
|
||||
- Bucket array allocates `4096` bytes. (enough for 16,384 entries)
|
||||
- Index array allocates `65536` bytes.
|
||||
- Light sphere array allocates `16384` bytes. (enough for 256 light spheres)
|
||||
@returns [[light-hash]]"
|
||||
- Bucket array allocates `4096` bytes. (enough for 16,384 entries)
|
||||
- Index array allocates `65536` bytes.
|
||||
- Light sphere array allocates `16384` bytes. (enough for 256 light spheres)
|
||||
@returns [[light-hash]]"
|
||||
(when (not *light-hash*)
|
||||
(set! *light-hash* (new 'loading-level 'light-hash))
|
||||
(set! (-> *light-hash* num-lights) (the-as uint 0))
|
||||
@@ -111,7 +111,7 @@
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defun-debug reset-light-hash ((arg0 light-hash))
|
||||
"Resets the global [[*light-hash*]] back to having `0` lights, indicies, and buckets.
|
||||
@returns [[none]]"
|
||||
@returns [[none]]"
|
||||
(set! (-> *light-hash* num-lights) (the-as uint 0))
|
||||
(set! (-> *light-hash* num-indices) (the-as uint 0))
|
||||
(set! (-> *light-hash* num-buckets) (the-as uint 0))
|
||||
@@ -201,9 +201,9 @@
|
||||
;; definition for function lookup-light-sphere-by-name
|
||||
(defun lookup-light-sphere-by-name ((name string) (hash light-hash))
|
||||
"Search through a given [[light-hash]]'s lights to find the one that matches the given name
|
||||
@param name The name to look for
|
||||
@param hash The hash to search through
|
||||
@returns Either the [[light]] or [[#f]]"
|
||||
@param name The name to look for
|
||||
@param hash The hash to search through
|
||||
@returns Either the [[light]] or [[#f]]"
|
||||
(when (and hash (nonzero? hash))
|
||||
(dotimes (num-lights (the-as int (-> hash num-lights)))
|
||||
(let ((light (-> hash light-sphere-array num-lights)))
|
||||
|
||||
+7
-7
@@ -49,9 +49,9 @@
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defun ripple-make-request ((waveform ripple-wave) (effect merc-effect))
|
||||
"Iterate through [[*ripple-globals*]] `requests` looking for the one that matches the provided `effect`
|
||||
If NOT found, append a new [[ripple-request]] with the providded `effect` and `waveform` to the end of the `requests`.
|
||||
|
||||
NOTE: There can only be 16 effects at a given time, NOOP if already at that limit!"
|
||||
If NOT found, append a new [[ripple-request]] with the providded `effect` and `waveform` to the end of the `requests`.
|
||||
|
||||
NOTE: There can only be 16 effects at a given time, NOOP if already at that limit!"
|
||||
(let ((v1-1 (-> *ripple-globals* count))
|
||||
(a2-1 (-> *ripple-globals* requests))
|
||||
(a3-0 0)
|
||||
@@ -107,10 +107,10 @@ NOTE: There can only be 16 effects at a given time, NOOP if already at that limi
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defun ripple-execute ()
|
||||
"Iterate through [[*ripple-globals*]] requests, from the end to index `0`
|
||||
For each request, if it has a `waveform` create the wave-table via `ripple-create-wave-table`
|
||||
Then for each `waveform` apply the `effect` using `ripple-apply-wave-table`
|
||||
|
||||
Once completed, all `requests` have been processed and the `count` is reset to `0`"
|
||||
For each request, if it has a `waveform` create the wave-table via `ripple-create-wave-table`
|
||||
Then for each `waveform` apply the `effect` using `ripple-apply-wave-table`
|
||||
|
||||
Once completed, all `requests` have been processed and the `count` is reset to `0`"
|
||||
(when (-> *ripple-globals* count)
|
||||
(ripple-execute-init)
|
||||
(let ((gp-0 0)
|
||||
|
||||
+7
-7
@@ -5,11 +5,11 @@
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defun set-video-mode ((tv-format symbol))
|
||||
"Set related settings to the video mode in the settings, [[*video-params*]] and the [[*video-mode*]]
|
||||
`ntsc` has a [[*video-mode*]] value of `0`, where as `pal` has a value of `1`
|
||||
|
||||
Will also set a bunch of common settings related to profiling and the camera to finalize the switch
|
||||
|
||||
@param tv-format Recognizes `ntsc` and `pal`"
|
||||
`ntsc` has a [[*video-mode*]] value of `0`, where as `pal` has a value of `1`
|
||||
|
||||
Will also set a bunch of common settings related to profiling and the camera to finalize the switch
|
||||
|
||||
@param tv-format Recognizes `ntsc` and `pal`"
|
||||
(case tv-format
|
||||
(('ntsc)
|
||||
(set! (-> *setting-control* user-default display-dx) 0)
|
||||
@@ -49,7 +49,7 @@ Will also set a bunch of common settings related to profiling and the camera to
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defun set-aspect-ratio ((aspect symbol))
|
||||
"Set [[*video-params*]] aspect-ratio related settings based on the mode provided.
|
||||
@param aspect Recognizes `aspect4x3` and `aspect16x9`"
|
||||
@param aspect Recognizes `aspect4x3` and `aspect16x9`"
|
||||
(case aspect
|
||||
(('aspect4x3)
|
||||
(set! (-> *video-params* relative-x-scale) 1.0)
|
||||
@@ -74,7 +74,7 @@ Will also set a bunch of common settings related to profiling and the camera to
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defun set-progressive-scan ((val symbol))
|
||||
"Flip the progressive scan setting flag depending on the value provided
|
||||
@param val The value to set the progressive scan flag to"
|
||||
@param val The value to set the progressive scan flag to"
|
||||
(set! (-> *setting-control* user-default use-progressive-scan) val)
|
||||
0
|
||||
(none)
|
||||
|
||||
+8
-8
@@ -53,7 +53,7 @@ Without this corrector, the fogginess of the world would change as the FOV chang
|
||||
;; ERROR: Failed store: (s.w! (+ a0-43 12) a1-11) at op 465
|
||||
(defun update-math-camera ((arg0 math-camera) (arg1 symbol) (arg2 symbol) (arg3 float))
|
||||
"Compute some one-time camera constants.
|
||||
These should only change when changing aspect ratio."
|
||||
These should only change when changing aspect ratio."
|
||||
(local-vars (sv-16 float))
|
||||
(set! (-> arg0 x-ratio) (tan (* 0.5 arg3)))
|
||||
(if (= arg2 'aspect4x3)
|
||||
@@ -285,8 +285,8 @@ These should only change when changing aspect ratio."
|
||||
;; INFO: Used lq/sq
|
||||
(defun move-target-from-pad ((arg0 transform) (arg1 int))
|
||||
"Unused function to adjust trans based on inputs from the pad.
|
||||
This function must be extremely old because it takes a non-quaternion transform,
|
||||
and all [[target]] stuff uses quaternions."
|
||||
This function must be extremely old because it takes a non-quaternion transform,
|
||||
and all [[target]] stuff uses quaternions."
|
||||
(let ((s4-0 (new-stack-vector0)))
|
||||
(set! (-> s4-0 x) (cond
|
||||
((cpad-hold? arg1 circle)
|
||||
@@ -350,8 +350,8 @@ and all [[target]] stuff uses quaternions."
|
||||
;; ERROR: Unsupported inline assembly instruction kind - [cfc2.i v1, Clipping]
|
||||
(defun transform-point-vector! ((arg0 vector) (arg1 vector))
|
||||
"Apply camera transformation to a point. Return true if it is visible or not.
|
||||
This returns the point in GS coords, but as float instead of int, so it's
|
||||
not really useful. See [[transform-point-qword!]] for more details."
|
||||
This returns the point in GS coords, but as float instead of int, so it's
|
||||
not really useful. See [[transform-point-qword!]] for more details."
|
||||
(local-vars (v1-2 int))
|
||||
(rlet ((acc :class vf)
|
||||
(Q :class vf)
|
||||
@@ -401,7 +401,7 @@ not really useful. See [[transform-point-qword!]] for more details."
|
||||
;; ERROR: Unsupported inline assembly instruction kind - [cfc2.i v1, Clipping]
|
||||
(defun transform-point-qword! ((arg0 vector4w) (arg1 vector))
|
||||
"Apply camera transformation to point, returning fixed point 28.4 position
|
||||
that can be given to the GS directly."
|
||||
that can be given to the GS directly."
|
||||
(local-vars (v1-2 int))
|
||||
(rlet ((acc :class vf)
|
||||
(Q :class vf)
|
||||
@@ -532,8 +532,8 @@ that can be given to the GS directly."
|
||||
;; WARN: Return type mismatch symbol vs none.
|
||||
(defun init-for-transform ((arg0 matrix))
|
||||
"Sets up VU0 registers with camera info.
|
||||
This is probably a very old function and it's only used by camera debug.
|
||||
It stashes some data in vector float registers that must be there before calling transform-float-point."
|
||||
This is probably a very old function and it's only used by camera debug.
|
||||
It stashes some data in vector float registers that must be there before calling transform-float-point."
|
||||
(local-vars (v1-14 float))
|
||||
(rlet ((vf1 :class vf)
|
||||
(vf17 :class vf)
|
||||
|
||||
+4
-4
@@ -94,8 +94,8 @@
|
||||
;; WARN: Return type mismatch pointer vs none.
|
||||
(defun init-overide-table ((table mood-table))
|
||||
"Similar to [[init-mood-table]], does the bare minimum to setup the given [[mood-table]]
|
||||
@param! table The table to initialize
|
||||
@returns [[none]]"
|
||||
@param! table The table to initialize
|
||||
@returns [[none]]"
|
||||
(set! (-> table mood-fog-table) (new 'debug 'mood-fog-table))
|
||||
(set! (-> table mood-color-table) (new 'debug 'mood-color-table))
|
||||
(set! (-> table mood-channel-group) *no-cloud-mood-channel-group*)
|
||||
@@ -260,7 +260,7 @@
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defun desaturate-mood-colors ((arg0 float) (arg1 float) (arg2 float))
|
||||
"Unused - Generate GOAL code for a new [[*overide-mood-color-table*]] definition that desaturates the color
|
||||
Apply said overrides to the [[*overide-table*]]"
|
||||
Apply said overrides to the [[*overide-table*]]"
|
||||
(mem-copy!
|
||||
(the-as pointer (-> *overide-table* mood-color-table))
|
||||
(the-as pointer *no-cloud-mood-color-table*)
|
||||
@@ -366,7 +366,7 @@ Apply said overrides to the [[*overide-table*]]"
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defun desaturate-mood-fog ((arg0 (pointer mood-fog-table)) (arg1 float) (arg2 float))
|
||||
"Unused - Generate GOAL code for a new [[*overide-mood-fog-table*]] definition that desaturates the fog color
|
||||
Apply said overrides to the [[*overide-table*]]"
|
||||
Apply said overrides to the [[*overide-table*]]"
|
||||
(mem-copy! (the-as pointer (-> *overide-table* mood-fog-table)) arg0 384)
|
||||
(dotimes (data-idx 8)
|
||||
(let ((fog-data (-> *overide-table* mood-fog-table data data-idx)))
|
||||
|
||||
+2
-2
@@ -827,8 +827,8 @@
|
||||
;; WARN: Return type mismatch symbol vs none.
|
||||
(defun init-mood-control ((ctrl mood-control))
|
||||
"Given a [[mood-control]] initialize and set it up with default settings
|
||||
@param! ctrl The [[mood-control]]
|
||||
@returns [[none]]"
|
||||
@param! ctrl The [[mood-control]]
|
||||
@returns [[none]]"
|
||||
(set! (-> ctrl mood-fog-table) (new 'global 'mood-fog-table))
|
||||
(set! (-> ctrl mood-color-table) (new 'global 'mood-color-table))
|
||||
(set! (-> ctrl mood-channel-group) (new 'global 'mood-channel-group))
|
||||
|
||||
+7
-7
@@ -1269,9 +1269,9 @@
|
||||
;; WARN: Return type mismatch int vs sound-id.
|
||||
(defmethod play-or-stop-lightning! ((this mood-control) (arg0 sound-spec) (arg1 vector))
|
||||
"Handles playing/stopping of the lightning sound
|
||||
- Plays the lightning sound if we are not loading and `lightning-id` is zero
|
||||
- Stops the lightning sound first if `lightning-id` is non-zero
|
||||
Returns the current value of `lightning-id`"
|
||||
- Plays the lightning sound if we are not loading and `lightning-id` is zero
|
||||
- Stops the lightning sound first if `lightning-id` is non-zero
|
||||
Returns the current value of `lightning-id`"
|
||||
(vector+! (new 'stack-no-clear 'vector) arg1 (math-camera-pos))
|
||||
(the-as sound-id (cond
|
||||
((or (load-in-progress? *level*) (movie?))
|
||||
@@ -1684,8 +1684,8 @@ Returns the current value of `lightning-id`"
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod update-mood-weather! ((this mood-control) (cloud-target float) (fog-target float) (cloud-speed float) (fog-speed float))
|
||||
"Set the `target-interp` and `speed-interp` for the clouds and fog
|
||||
If `*-speed` is 0.0, use the `*-target` args to set `current-interp`
|
||||
See [[mood-weather]]"
|
||||
If `*-speed` is 0.0, use the `*-target` args to set `current-interp`
|
||||
See [[mood-weather]]"
|
||||
(set! (-> this target-interp cloud) cloud-target)
|
||||
(set! (-> this target-interp fog) fog-target)
|
||||
(set! (-> this speed-interp cloud) cloud-speed)
|
||||
@@ -1704,7 +1704,7 @@ See [[mood-weather]]"
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod update-mood-range! ((this mood-control) (min-cloud float) (max-cloud float) (min-fog float) (max-fog float))
|
||||
"Set the minimum and maximum ranges of clouds and fog
|
||||
See [[mood-range]]"
|
||||
See [[mood-range]]"
|
||||
(set! (-> this range min-cloud) min-cloud)
|
||||
(set! (-> this range max-cloud) max-cloud)
|
||||
(set! (-> this range min-fog) min-fog)
|
||||
@@ -1717,7 +1717,7 @@ See [[mood-range]]"
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod set-time-for-random-weather! ((this mood-control) (arg0 float) (arg1 float))
|
||||
"Set the `time-until-random`'s cloud and fog values
|
||||
See [[mood-weather]]"
|
||||
See [[mood-weather]]"
|
||||
(set! (-> this time-until-random cloud) arg0)
|
||||
(set! (-> this time-until-random fog) arg1)
|
||||
0
|
||||
|
||||
+2
-2
@@ -265,8 +265,8 @@ Each texture page has 3 segments - smaller number segments have higher detail mi
|
||||
;; definition for function texture-mip->segment
|
||||
(defun texture-mip->segment ((arg0 int) (arg1 int))
|
||||
"Figure out which segment of a tpage a given mip level of a texture will be in.
|
||||
arg0 is the mip level, arg1 is the total number of mips.
|
||||
Higher mip level is lower detail."
|
||||
arg0 is the mip level, arg1 is the total number of mips.
|
||||
Higher mip level is lower detail."
|
||||
(if (>= 2 arg1)
|
||||
(+ (- -1 arg0) arg1)
|
||||
(max 0 (- 2 arg0))
|
||||
|
||||
+43
-43
@@ -65,7 +65,7 @@
|
||||
;; definition for function texture-qwc
|
||||
(defun texture-qwc ((w int) (h int) (tex-format gs-psm))
|
||||
"Get the number of quadwords needed for a given texture size and format.
|
||||
Does not consider weird PS2 memory layout stuff."
|
||||
Does not consider weird PS2 memory layout stuff."
|
||||
(let ((v1-0 (texture-bpp tex-format)))
|
||||
(/ (+ (* (* w h) v1-0) 127) 128)
|
||||
)
|
||||
@@ -74,7 +74,7 @@ Does not consider weird PS2 memory layout stuff."
|
||||
;; definition for function physical-address
|
||||
(defun physical-address ((addr pointer))
|
||||
"Strip off high 8-bits of a pointer, to bypass the uncached memory mappings.
|
||||
This gives an address suitable for DMAing from main memory."
|
||||
This gives an address suitable for DMAing from main memory."
|
||||
(logand #xfffffff addr)
|
||||
)
|
||||
|
||||
@@ -82,8 +82,8 @@ This gives an address suitable for DMAing from main memory."
|
||||
;; WARN: Return type mismatch symbol vs none.
|
||||
(defun dma-buffer-add-ref-texture ((dma-buf dma-buffer) (tex-data-ptr pointer) (width int) (height int) (tex-fmt gs-psm))
|
||||
"Upload a texture, by reference. Doesn't copy the texture into the DMA buffer - just a reference,
|
||||
so it is up to the user to make sure the texture is valid during DMA time.
|
||||
Doesn't set up GIF for receiving textures."
|
||||
so it is up to the user to make sure the texture is valid during DMA time.
|
||||
Doesn't set up GIF for receiving textures."
|
||||
(let ((padr (physical-address tex-data-ptr))
|
||||
(qwc-remaining (texture-qwc width height tex-fmt))
|
||||
)
|
||||
@@ -295,9 +295,9 @@ Doesn't set up GIF for receiving textures."
|
||||
;; definition for function gs-blocks-used
|
||||
(defun gs-blocks-used ((w int) (h int) (tex-format gs-psm))
|
||||
"Get the number of blocks used by a texture.
|
||||
If the texture isn't an even number of pages, the partially completed
|
||||
page will be counted as the largest used block.
|
||||
(gaps in this page are counted as used)"
|
||||
If the texture isn't an even number of pages, the partially completed
|
||||
page will be counted as the largest used block.
|
||||
(gaps in this page are counted as used)"
|
||||
(let* ((s4-0 (gs-page-width tex-format))
|
||||
(v1-0 (gs-page-height tex-format))
|
||||
(a0-6 (* (/ (+ s4-0 -1 w) s4-0) s4-0))
|
||||
@@ -435,7 +435,7 @@ page will be counted as the largest used block.
|
||||
;; definition for method 9 of type texture-page
|
||||
(defmethod remove-data-from-heap ((this texture-page) (heap kheap))
|
||||
"Bump the kheap pointer to discard this texture data. All metadata is kept.
|
||||
This is only safe to use if the last thing on the kheap is this texture."
|
||||
This is only safe to use if the last thing on the kheap is this texture."
|
||||
(set! (-> heap current) (-> this segment 0 block-data))
|
||||
this
|
||||
)
|
||||
@@ -443,8 +443,8 @@ This is only safe to use if the last thing on the kheap is this texture."
|
||||
;; definition for function texture-page-default-allocate
|
||||
(defun texture-page-default-allocate ((pool texture-pool) (tpage texture-page) (heap kheap) (tpage-id int))
|
||||
"Texture allocation function for textures that permanently live in VRAM.
|
||||
The texture data is immediately uploaded, then discarded from the heap.
|
||||
This should only be called during startup."
|
||||
The texture data is immediately uploaded, then discarded from the heap.
|
||||
This should only be called during startup."
|
||||
(dotimes (seg 3)
|
||||
(let ((vram-loc (allocate-vram-words! pool (the-as int (-> tpage segment seg size)))))
|
||||
(relocate-dests! tpage vram-loc seg)
|
||||
@@ -470,8 +470,8 @@ This should only be called during startup."
|
||||
;; definition for function texture-page-common-allocate
|
||||
(defun texture-page-common-allocate ((pool texture-pool) (page texture-page) (heap kheap) (page-id int))
|
||||
"Texture allocation function for textures that share the common segment.
|
||||
The texture remains in RAM, and is uploaded to VRAM as needed as part
|
||||
of the main drawing DMA chain."
|
||||
The texture remains in RAM, and is uploaded to VRAM as needed as part
|
||||
of the main drawing DMA chain."
|
||||
(let ((s5-0 (-> pool segment-common dest)))
|
||||
(dotimes (s4-0 3)
|
||||
(relocate-dests! page (the-as int s5-0) s4-0)
|
||||
@@ -485,8 +485,8 @@ of the main drawing DMA chain."
|
||||
;; definition for function texture-page-font-allocate
|
||||
(defun texture-page-font-allocate ((pool texture-pool) (tpage texture-page) (heap kheap) (tpage-id int))
|
||||
"Texture allocation function for font. This temporarily stores them in the common segment,
|
||||
removes them from RAM. This is a bit of hack. Later font setup code expects the font texture
|
||||
to be in common, and they will eventually be moved into the upper 8-bits of the depth buffer."
|
||||
removes them from RAM. This is a bit of hack. Later font setup code expects the font texture
|
||||
to be in common, and they will eventually be moved into the upper 8-bits of the depth buffer."
|
||||
(texture-page-common-allocate pool tpage heap tpage-id)
|
||||
(upload-now! tpage (tex-upload-mode seg0-1-2))
|
||||
(remove-data-from-heap tpage heap)
|
||||
@@ -668,7 +668,7 @@ to be in common, and they will eventually be moved into the upper 8-bits of the
|
||||
;; definition for function texture-page-common-boot-allocate
|
||||
(defun texture-page-common-boot-allocate ((pool texture-pool) (tpage texture-page) (heap kheap) (tpage-id int))
|
||||
"Allocator function for texture loaded at startup time.
|
||||
For jak 3, this seems to always do default-allocate (permanently in vram?)"
|
||||
For jak 3, this seems to always do default-allocate (permanently in vram?)"
|
||||
(let ((common-page-slot-id (get-common-page-slot-by-id pool tpage-id)))
|
||||
(cond
|
||||
((>= common-page-slot-id 0)
|
||||
@@ -753,9 +753,9 @@ For jak 3, this seems to always do default-allocate (permanently in vram?)"
|
||||
(bucket bucket-id)
|
||||
)
|
||||
"Add DMA to upload a texture page. Will only upload the portion of data that is not already present in VRAM.
|
||||
This is the old Jak 1 background texture uploading system, which had this near/far concept
|
||||
for different mip levels. By jak 2, the background system switched to masks and uses
|
||||
the -pris variant of this function."
|
||||
This is the old Jak 1 background texture uploading system, which had this near/far concept
|
||||
for different mip levels. By jak 2, the background system switched to masks and uses
|
||||
the -pris variant of this function."
|
||||
(local-vars
|
||||
(data-ptr pointer)
|
||||
(vram-ptr uint)
|
||||
@@ -903,10 +903,10 @@ the -pris variant of this function."
|
||||
(arg4 (pointer int32))
|
||||
)
|
||||
"Similar to upload-vram-pages, but skips the near/far mode and instead uses masks.
|
||||
The foreground/background renderers will generate masks telling us which textures are used.
|
||||
This lets us skip uploading entire textures, or mip levels that won't need.
|
||||
(side note: this optimization is what causes many of the texturing issues in pcsx2,
|
||||
where the ps2 and pcsx2 disagree on the mip level to use.)"
|
||||
The foreground/background renderers will generate masks telling us which textures are used.
|
||||
This lets us skip uploading entire textures, or mip levels that won't need.
|
||||
(side note: this optimization is what causes many of the texturing issues in pcsx2,
|
||||
where the ps2 and pcsx2 disagree on the mip level to use.)"
|
||||
(local-vars
|
||||
(data-ptr pointer)
|
||||
(vram-ptr uint)
|
||||
@@ -1614,8 +1614,8 @@ where the ps2 and pcsx2 disagree on the mip level to use.)"
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod setup-font-texture ((this texture-pool))
|
||||
"Set up the font texture. In normal use, the font texture is allocated, and currently uploaded to, the common segment.
|
||||
This function copies that to the unused upper 8-bits of the depth buffer, and sets up the font
|
||||
renderer to point to that address."
|
||||
This function copies that to the unused upper 8-bits of the depth buffer, and sets up the font
|
||||
renderer to point to that address."
|
||||
(local-vars (sv-16 int) (sv-20 int))
|
||||
(let ((s3-0 (-> this font-palette)))
|
||||
(set! sv-16 (-> this cur))
|
||||
@@ -1762,9 +1762,9 @@ renderer to point to that address."
|
||||
;; definition for method 7 of type texture-page
|
||||
(defmethod relocate ((this texture-page) (loading-heap kheap) (name (pointer uint8)))
|
||||
"Handle a texture page that has been loaded by the linker.
|
||||
This must run in the linker, since we sometimes kick out textures from the loading heap, which
|
||||
requires no more allocations made after the texture, and the only time is right after the linker
|
||||
does the allocation for this GOAL object file."
|
||||
This must run in the linker, since we sometimes kick out textures from the loading heap, which
|
||||
requires no more allocations made after the texture, and the only time is right after the linker
|
||||
does the allocation for this GOAL object file."
|
||||
(cond
|
||||
((or (not this) (not (file-info-correct-version? (-> this info) (file-kind tpage) 0)))
|
||||
(the-as texture-page #f)
|
||||
@@ -1811,9 +1811,9 @@ does the allocation for this GOAL object file."
|
||||
;; definition for function relocate-later
|
||||
(defun relocate-later ()
|
||||
"Unused in jak 2 and likely unsed in jak 3. Feature to postpone some texture copying until
|
||||
a later frame. This is only used in cases when texture data must be memcpy'd in RAM, to patch up a hole left
|
||||
by some data that is now permanently in VRAM, and no longer needed.
|
||||
Note that Jak2/Jak3 don't have this problem since level textures are now never permanent"
|
||||
a later frame. This is only used in cases when texture data must be memcpy'd in RAM, to patch up a hole left
|
||||
by some data that is now permanently in VRAM, and no longer needed.
|
||||
Note that Jak2/Jak3 don't have this problem since level textures are now never permanent"
|
||||
(let ((gp-0 *texture-relocate-later*))
|
||||
(let ((s5-0 (-> gp-0 entry))
|
||||
(s4-0 (-> gp-0 page))
|
||||
@@ -1834,9 +1834,9 @@ Note that Jak2/Jak3 don't have this problem since level textures are now never p
|
||||
;; definition for function texture-page-login
|
||||
(defun texture-page-login ((id texture-id) (alloc-func (function texture-pool texture-page kheap int texture-page)) (heap kheap))
|
||||
"'Login' (initialize) a texture page with the pool.
|
||||
This has a trick - it doesn't actually require you to pass a texture-page object - instead you pass an ID.
|
||||
If the texture was loaded at all, it will already be known to the texture pool, and this function will do nothing.
|
||||
However, if the texture is not present, it will be loaded through a call to `loado`, for use in development."
|
||||
This has a trick - it doesn't actually require you to pass a texture-page object - instead you pass an ID.
|
||||
If the texture was loaded at all, it will already be known to the texture pool, and this function will do nothing.
|
||||
However, if the texture is not present, it will be loaded through a call to `loado`, for use in development."
|
||||
(when (and (nonzero? (-> id page)) (< (-> id page) (the-as uint (-> *texture-page-dir* length))))
|
||||
(let ((s5-0 (-> *texture-page-dir* entries (-> id page))))
|
||||
(when (not (-> s5-0 page))
|
||||
@@ -1984,7 +1984,7 @@ However, if the texture is not present, it will be loaded through a call to `loa
|
||||
;; definition for function link-texture-by-id
|
||||
(defun link-texture-by-id ((id texture-id) (shader adgif-shader))
|
||||
"Add this adgif shader to the linked list of shaders associated with the given texture ID.
|
||||
Will allocate the link array if it's not already."
|
||||
Will allocate the link array if it's not already."
|
||||
(when (not (or (zero? (-> id page)) (>= (-> id page) (the-as uint (-> *texture-page-dir* length)))))
|
||||
(let ((s4-0 (-> *texture-page-dir* entries (-> id page))))
|
||||
(if (not (-> s4-0 link))
|
||||
@@ -2082,8 +2082,8 @@ Will allocate the link array if it's not already."
|
||||
;; definition for function adgif-shader-login
|
||||
(defun adgif-shader-login ((shader adgif-shader))
|
||||
"set up an adgif shader with the texture-pool, so it points to the right vram address.
|
||||
Will remap textures through the level remap table.
|
||||
If texture is missing, will load it on debug hardware."
|
||||
Will remap textures through the level remap table.
|
||||
If texture is missing, will load it on debug hardware."
|
||||
(when (logtest? (-> shader link-test) (link-test-flags needs-log-in))
|
||||
(logclear! (-> shader link-test) (link-test-flags needs-log-in bit-9))
|
||||
(set! (-> shader texture-id) (level-remap-texture (-> shader texture-id)))
|
||||
@@ -2119,7 +2119,7 @@ If texture is missing, will load it on debug hardware."
|
||||
;; definition for function adgif-shader-login-no-remap
|
||||
(defun adgif-shader-login-no-remap ((shader adgif-shader))
|
||||
"Set up an adgif shader with the texture-pool, so it points to the right vram adress.
|
||||
This does not do level tpage remapping, so the texture should be one that's not loaded in a combine level tpage."
|
||||
This does not do level tpage remapping, so the texture should be one that's not loaded in a combine level tpage."
|
||||
(when (logtest? (-> shader link-test) (link-test-flags needs-log-in))
|
||||
(logclear! (-> shader link-test) (link-test-flags needs-log-in bit-9))
|
||||
(link-texture-by-id (-> shader texture-id) shader)
|
||||
@@ -2149,9 +2149,9 @@ This does not do level tpage remapping, so the texture should be one that's not
|
||||
;; definition for function adgif-shader-login-fast
|
||||
(defun adgif-shader-login-fast ((shader adgif-shader))
|
||||
"Set up an adgif shader with the texture-pool, so it points to the right vram address.
|
||||
Will remap through the level table, so can be used to refer to textures inside 'squashed'
|
||||
level tpages.
|
||||
Will not load texture if it is missing."
|
||||
Will remap through the level table, so can be used to refer to textures inside 'squashed'
|
||||
level tpages.
|
||||
Will not load texture if it is missing."
|
||||
(when (logtest? (-> shader link-test) (link-test-flags needs-log-in))
|
||||
(logclear! (-> shader link-test) (link-test-flags needs-log-in bit-9))
|
||||
(set! (-> shader texture-id) (level-remap-texture (-> shader texture-id)))
|
||||
@@ -2182,8 +2182,8 @@ Will not load texture if it is missing."
|
||||
;; definition for function adgif-shader-login-no-remap-fast
|
||||
(defun adgif-shader-login-no-remap-fast ((shader adgif-shader))
|
||||
"Set up an adgif shader with the texture-pool, so it points to the right vram address.
|
||||
Will not remap through the level tpage table.
|
||||
Will not load texture if it is missing."
|
||||
Will not remap through the level tpage table.
|
||||
Will not load texture if it is missing."
|
||||
(when (logtest? (-> shader link-test) (link-test-flags needs-log-in))
|
||||
(logclear! (-> shader link-test) (link-test-flags needs-log-in bit-9))
|
||||
(let ((v1-4 (-> shader texture-id)))
|
||||
@@ -2219,7 +2219,7 @@ Will not load texture if it is missing."
|
||||
;; definition for function adgif-shader<-texture-simple!
|
||||
(defun adgif-shader<-texture-simple! ((shader adgif-shader) (tex texture))
|
||||
"Simple adgif-shader to texture, just sets vram address and format stuff.
|
||||
Intended for use with fancy texture stuff that will later set the other regs."
|
||||
Intended for use with fancy texture stuff that will later set the other regs."
|
||||
(set! (-> shader tex1) (new 'static 'gs-tex1 :mmag #x1 :mmin #x1))
|
||||
(set! (-> shader tex0 tfx) 0)
|
||||
(if tex
|
||||
|
||||
+4
-4
@@ -496,10 +496,10 @@
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod collect-regions ((this bsp-header) (arg0 sphere) (arg1 int) (arg2 region-prim-list))
|
||||
"Determines the number of [[drawable]]s in the `obj` that overlap the given `area-of-interest` this number is stored in the `region-list`'s item count
|
||||
@param area-of-interest The area defined by a sphere that we care about overlaps
|
||||
@param _count The amount of [[drawable]]s in the object to enumerate through
|
||||
@param! region-list Stores the overlapping regions and a count for how many were found
|
||||
@returns none"
|
||||
@param area-of-interest The area defined by a sphere that we care about overlaps
|
||||
@param _count The amount of [[drawable]]s in the object to enumerate through
|
||||
@param! region-list Stores the overlapping regions and a count for how many were found
|
||||
@returns none"
|
||||
(let ((s3-0 (-> this region-trees)))
|
||||
(dotimes (s2-0 (-> s3-0 length))
|
||||
(collect-regions (-> s3-0 s2-0) arg0 arg1 arg2)
|
||||
|
||||
+28
-28
@@ -47,10 +47,10 @@
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod collect-regions ((this drawable-region-prim) (area-of-interest sphere) (_count int) (region-list region-prim-list))
|
||||
"Determines the number of [[drawable]]s in the `obj` that overlap the given `area-of-interest` this number is stored in the `region-list`'s item count
|
||||
@param area-of-interest The area defined by a sphere that we care about overlaps
|
||||
@param _count The amount of [[drawable]]s in the object to enumerate through
|
||||
@param! region-list Stores the overlapping regions and a count for how many were found
|
||||
@returns none"
|
||||
@param area-of-interest The area defined by a sphere that we care about overlaps
|
||||
@param _count The amount of [[drawable]]s in the object to enumerate through
|
||||
@param! region-list Stores the overlapping regions and a count for how many were found
|
||||
@returns none"
|
||||
(dotimes (count _count)
|
||||
(when (spheres-overlap? area-of-interest (the-as sphere (-> this bsphere)))
|
||||
(set! (-> region-list items (-> region-list num-items)) this)
|
||||
@@ -66,10 +66,10 @@
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod collect-regions ((this drawable-inline-array-region-prim) (arg0 sphere) (arg1 int) (arg2 region-prim-list))
|
||||
"Determines the number of [[drawable]]s in the `obj` that overlap the given `area-of-interest` this number is stored in the `region-list`'s item count
|
||||
@param area-of-interest The area defined by a sphere that we care about overlaps
|
||||
@param _count The amount of [[drawable]]s in the object to enumerate through
|
||||
@param! region-list Stores the overlapping regions and a count for how many were found
|
||||
@returns none"
|
||||
@param area-of-interest The area defined by a sphere that we care about overlaps
|
||||
@param _count The amount of [[drawable]]s in the object to enumerate through
|
||||
@param! region-list Stores the overlapping regions and a count for how many were found
|
||||
@returns none"
|
||||
(collect-regions (the-as drawable-region-prim (-> this data)) arg0 (-> this length) arg2)
|
||||
0
|
||||
(none)
|
||||
@@ -79,10 +79,10 @@
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod collect-regions ((this drawable-tree-region-prim) (arg0 sphere) (arg1 int) (arg2 region-prim-list))
|
||||
"Determines the number of [[drawable]]s in the `obj` that overlap the given `area-of-interest` this number is stored in the `region-list`'s item count
|
||||
@param area-of-interest The area defined by a sphere that we care about overlaps
|
||||
@param _count The amount of [[drawable]]s in the object to enumerate through
|
||||
@param! region-list Stores the overlapping regions and a count for how many were found
|
||||
@returns none"
|
||||
@param area-of-interest The area defined by a sphere that we care about overlaps
|
||||
@param _count The amount of [[drawable]]s in the object to enumerate through
|
||||
@param! region-list Stores the overlapping regions and a count for how many were found
|
||||
@returns none"
|
||||
(collect-regions (-> this data2 0) arg0 (-> this length) arg2)
|
||||
0
|
||||
(none)
|
||||
@@ -162,10 +162,10 @@
|
||||
;; WARN: Function (method 9 region-prim-area) has a return type of none, but the expression builder found a return statement.
|
||||
(defmethod track-entered-region! ((this region-prim-area) (region-sphere drawable-region-sphere))
|
||||
"Enumerates through the objects `region-enter-list`, if we find the provided `region`, do nothing and exit
|
||||
otherwise, add the [[drawable-region-sphere]] to `region-enter-prim-list` and increment `region-enter-count`
|
||||
|
||||
@param region-sphere Defines the region in question
|
||||
@returns nothing"
|
||||
otherwise, add the [[drawable-region-sphere]] to `region-enter-prim-list` and increment `region-enter-count`
|
||||
|
||||
@param region-sphere Defines the region in question
|
||||
@returns nothing"
|
||||
(let ((regions-entered (-> this region-enter-count)))
|
||||
(let ((region (-> region-sphere region)))
|
||||
(countdown (idx regions-entered)
|
||||
@@ -187,10 +187,10 @@ otherwise, add the [[drawable-region-sphere]] to `region-enter-prim-list` and in
|
||||
;; WARN: Function (method 10 region-prim-area) has a return type of none, but the expression builder found a return statement.
|
||||
(defmethod track-exited-region! ((this region-prim-area) (arg0 drawable-region-sphere))
|
||||
"Enumerates through the objects `region-exit-list`, if we find the provided `region`, do nothing and exit
|
||||
otherwise, add the [[drawable-region-sphere]] to `region-exit-prim-list` and increment `region-exit-count`
|
||||
|
||||
@param region-sphere Defines the region in question
|
||||
@returns nothing"
|
||||
otherwise, add the [[drawable-region-sphere]] to `region-exit-prim-list` and increment `region-exit-count`
|
||||
|
||||
@param region-sphere Defines the region in question
|
||||
@returns nothing"
|
||||
(let ((regions-exited (-> this region-exit-count)))
|
||||
(let ((region (-> arg0 region)))
|
||||
(countdown (idx regions-exited)
|
||||
@@ -212,10 +212,10 @@ otherwise, add the [[drawable-region-sphere]] to `region-exit-prim-list` and inc
|
||||
;; WARN: Function (method 11 region-prim-area) has a return type of none, but the expression builder found a return statement.
|
||||
(defmethod track-inside-region! ((this region-prim-area) (arg0 drawable-region-sphere))
|
||||
"Enumerates through the objects `region-inside-list`, if we find the provided `region`, do nothing and exit
|
||||
otherwise, add the [[drawable-region-sphere]] to `region-inside-prim-list` and increment `region-inside-count`
|
||||
|
||||
@param region-sphere Defines the region in question
|
||||
@returns nothing"
|
||||
otherwise, add the [[drawable-region-sphere]] to `region-inside-prim-list` and increment `region-inside-count`
|
||||
|
||||
@param region-sphere Defines the region in question
|
||||
@returns nothing"
|
||||
(let ((regions-inside (-> this region-inside-count)))
|
||||
(let ((region (-> arg0 region)))
|
||||
(countdown (idx regions-inside)
|
||||
@@ -237,10 +237,10 @@ otherwise, add the [[drawable-region-sphere]] to `region-inside-prim-list` and i
|
||||
;; WARN: Function (method 12 region-prim-area) has a return type of none, but the expression builder found a return statement.
|
||||
(defmethod track-start-region! ((this region-prim-area) (arg0 drawable-region-sphere))
|
||||
"Enumerates through the objects `region-start-list`, if we find the provided `region`, do nothing and exit
|
||||
otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and increment `region-start-count`
|
||||
|
||||
@param region-sphere Defines the region in question
|
||||
@returns nothing"
|
||||
otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and increment `region-start-count`
|
||||
|
||||
@param region-sphere Defines the region in question
|
||||
@returns nothing"
|
||||
(let ((regions-started (-> this region-start-count)))
|
||||
(let ((region (-> arg0 region)))
|
||||
(countdown (idx regions-started)
|
||||
|
||||
+10
-10
@@ -41,7 +41,7 @@
|
||||
;; definition for function file-stream-read-string
|
||||
(defun file-stream-read-string ((fs file-stream) (str string))
|
||||
"Fill a string with data from a file stream.
|
||||
Note: this function does not work."
|
||||
Note: this function does not work."
|
||||
(clear str)
|
||||
(file-stream-read fs (-> str data) (length fs))
|
||||
str
|
||||
@@ -97,13 +97,13 @@ Note: this function does not work."
|
||||
;; definition for function make-file-name
|
||||
(defun make-file-name ((arg0 file-kind) (arg1 string) (arg2 int) (arg3 symbol))
|
||||
"Get a file name to open a file with the given kind and name.
|
||||
The art-group-version argument can be used to override the version
|
||||
of the art-group. Set it to 0 or less to use the default version.
|
||||
Similar to MakeFileName in C.
|
||||
Note: file type enum is different between C and GOAL.
|
||||
File versions should match those in versions.h.
|
||||
Uses a single *file-temp-string* buffer, shared with make-vfile-name.
|
||||
arg3 is unused."
|
||||
The art-group-version argument can be used to override the version
|
||||
of the art-group. Set it to 0 or less to use the default version.
|
||||
Similar to MakeFileName in C.
|
||||
Note: file type enum is different between C and GOAL.
|
||||
File versions should match those in versions.h.
|
||||
Uses a single *file-temp-string* buffer, shared with make-vfile-name.
|
||||
arg3 is unused."
|
||||
(clear *file-temp-string*)
|
||||
(cond
|
||||
((= arg0 (file-kind dir-tpage))
|
||||
@@ -150,7 +150,7 @@ arg3 is unused."
|
||||
;; definition for function make-vfile-name
|
||||
(defun make-vfile-name ((kind file-kind) (name string))
|
||||
"Make virtual? file name. This makes a name that the kernel knows how to
|
||||
handle in a specific way. This function is not used."
|
||||
handle in a specific way. This function is not used."
|
||||
(clear *file-temp-string*)
|
||||
(cond
|
||||
((= kind (file-kind level-bt))
|
||||
@@ -166,7 +166,7 @@ handle in a specific way. This function is not used."
|
||||
;; definition for function file-info-correct-version?
|
||||
(defun file-info-correct-version? ((arg0 file-info) (arg1 file-kind) (arg2 int))
|
||||
"Check if the version and kind in the info is valid. The `version-override` can specify a
|
||||
non-default version, or set to 0 for the default version."
|
||||
non-default version, or set to 0 for the default version."
|
||||
(let* ((s5-0 (cond
|
||||
((zero? arg2)
|
||||
(case arg1
|
||||
|
||||
+3
-3
@@ -147,8 +147,8 @@
|
||||
;; definition for function str-load-status
|
||||
(defun str-load-status ((maxlen-out (pointer int32)))
|
||||
"Get the status of the most recent load.
|
||||
Return 'busy if in progress, 'error if failed, or 'complete.
|
||||
If 'complete, returns the maxlen value from the IOP."
|
||||
Return 'busy if in progress, 'error if failed, or 'complete.
|
||||
If 'complete, returns the maxlen value from the IOP."
|
||||
(if (check-busy *load-str-rpc*)
|
||||
(return 'busy)
|
||||
)
|
||||
@@ -372,7 +372,7 @@ If 'complete, returns the maxlen value from the IOP."
|
||||
;; definition for function find-temp-buffer
|
||||
(defun find-temp-buffer ((size int))
|
||||
"Unused function to find some temporary leftover space in DMA buffer.
|
||||
Unused since jak 1, and checks the same buffer twice??"
|
||||
Unused since jak 1, and checks the same buffer twice??"
|
||||
(let ((gp-0 (+ (/ size 16) 2)))
|
||||
(cond
|
||||
((< (the-as uint gp-0)
|
||||
|
||||
+1
-1
@@ -97,7 +97,7 @@
|
||||
;; definition for function matrix->eul
|
||||
(defun matrix->eul ((arg0 euler-angles) (arg1 matrix) (arg2 int))
|
||||
"Convert matrix to euler angles with given order flag.
|
||||
Not clear how this works if the matrix has more than just a rotation."
|
||||
Not clear how this works if the matrix has more than just a rotation."
|
||||
0
|
||||
0
|
||||
0
|
||||
|
||||
+16
-16
@@ -4,7 +4,7 @@
|
||||
;; definition for function truncate
|
||||
(defun truncate ((arg0 float))
|
||||
"Round (toward zero) to an integer.
|
||||
@param arg0 float to truncate"
|
||||
@param arg0 float to truncate"
|
||||
(the float (the int arg0))
|
||||
)
|
||||
|
||||
@@ -324,8 +324,8 @@
|
||||
;; definition for function seek-ease
|
||||
(defun seek-ease ((arg0 float) (arg1 float) (arg2 float) (arg3 float) (arg4 float))
|
||||
"Move arg0 toward arg1, and slow down before reaching the end.
|
||||
When farther than arg3 away, move by at most arg2.
|
||||
When closer than arg3, linearly ramp down the movement amount from arg2 to 0 but no lower than arg4."
|
||||
When farther than arg3 away, move by at most arg2.
|
||||
When closer than arg3, linearly ramp down the movement amount from arg2 to 0 but no lower than arg4."
|
||||
(let ((f2-0 (- arg1 arg0)))
|
||||
(when (>= arg3 (fabs f2-0))
|
||||
(set! arg2 (* arg2 (- 1.0 (/ (- arg3 (fabs f2-0)) arg3))))
|
||||
@@ -350,9 +350,9 @@ When closer than arg3, linearly ramp down the movement amount from arg2 to 0 but
|
||||
;; definition for function seek-ease-in-out
|
||||
(defun seek-ease-in-out ((arg0 float) (arg1 float) (arg2 float) (arg3 float) (arg4 float) (arg5 float) (arg6 float))
|
||||
"Move arg0 toward arg2, and slow down at the start and end.
|
||||
When within arg4 of arg1 (at the beginning of movement), ramp up speed, with a minimum speed of arg6
|
||||
When within arg5 of arg2 (at the end of movement), ramp down speed, with a minimum speed of arg5
|
||||
Normally, move at most arg3"
|
||||
When within arg4 of arg1 (at the beginning of movement), ramp up speed, with a minimum speed of arg6
|
||||
When within arg5 of arg2 (at the end of movement), ramp down speed, with a minimum speed of arg5
|
||||
Normally, move at most arg3"
|
||||
(let ((f2-0 (- arg2 arg0)))
|
||||
(let ((f4-1 (- arg0 arg1)))
|
||||
(when (>= arg4 (fabs f4-1))
|
||||
@@ -391,7 +391,7 @@ Normally, move at most arg3"
|
||||
;; definition (debug) for function lerp-scale-old
|
||||
(defun-debug lerp-scale-old ((arg0 float) (arg1 float) (arg2 float) (arg3 float) (arg4 float))
|
||||
"Linearly remap arg2 in [arg3, arg4] to [arg0, arg1].
|
||||
This is the jak 1 implementation, which I claimed was a bad implementation..."
|
||||
This is the jak 1 implementation, which I claimed was a bad implementation..."
|
||||
(let ((f0-1 (fmax 0.0 (fmin 1.0 (/ (- arg2 arg3) (- arg4 arg3))))))
|
||||
(+ (* (- 1.0 f0-1) arg0) (* f0-1 arg1))
|
||||
)
|
||||
@@ -497,8 +497,8 @@ This is the jak 1 implementation, which I claimed was a bad implementation..."
|
||||
;; ERROR: Inline assembly instruction marked with TODO - [TODO.VRGET]
|
||||
(defun rand-vu-nostep ()
|
||||
"Get the number currently in the random generator.
|
||||
This will be equal to the last call of (rand-vu).
|
||||
This will not update the random generator."
|
||||
This will be equal to the last call of (rand-vu).
|
||||
This will not update the random generator."
|
||||
(local-vars (v0-0 float))
|
||||
(rlet ((vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
@@ -548,7 +548,7 @@ This will not update the random generator."
|
||||
;; WARN: new jak 2 until loop case, check carefully
|
||||
(defun rand-vu-int-count-excluding ((arg0 int) (arg1 int))
|
||||
"Get an integer in the range [0, arg0).
|
||||
If bit n is set in arg1, exclude this value from being returned."
|
||||
If bit n is set in arg1, exclude this value from being returned."
|
||||
(let ((s4-0 0)
|
||||
(s5-0 0)
|
||||
)
|
||||
@@ -591,7 +591,7 @@ If bit n is set in arg1, exclude this value from being returned."
|
||||
;; WARN: new jak 2 until loop case, check carefully
|
||||
(defun rand-vu-int-range-exclude ((arg0 int) (arg1 int) (arg2 int))
|
||||
"Get an integer in the range [0, arg0), excluding arg2.
|
||||
Note that this doesn't use bits like rand-vu-int-count-excluding."
|
||||
Note that this doesn't use bits like rand-vu-int-count-excluding."
|
||||
(until #f
|
||||
(let ((v1-0 (rand-vu-int-range arg0 arg1)))
|
||||
(if (!= v1-0 arg2)
|
||||
@@ -676,7 +676,7 @@ Note that this doesn't use bits like rand-vu-int-count-excluding."
|
||||
;; definition for function smooth-step
|
||||
(defun smooth-step ((arg0 float))
|
||||
"Interpolate between 0, 1 with a cubic polynomial.
|
||||
These are picked so f(0) = 0, f(1) = 1, f'(0) = f'(1) = 0."
|
||||
These are picked so f(0) = 0, f(1) = 1, f'(0) = f'(1) = 0."
|
||||
(cond
|
||||
((>= 0.0 arg0)
|
||||
0.0
|
||||
@@ -693,9 +693,9 @@ These are picked so f(0) = 0, f(1) = 1, f'(0) = f'(1) = 0."
|
||||
;; definition for function smooth-interp
|
||||
(defun smooth-interp ((arg0 float) (arg1 float) (arg2 float) (arg3 float) (arg4 float))
|
||||
"Remap arg2 from (arg3, arg4) to (arg0, arg1), using cubic interpolation.
|
||||
Satisfies:
|
||||
- f(arg3) = arg0
|
||||
- f(arg4) = arg1
|
||||
- f'(arg3) = f'(arg4) = 0"
|
||||
Satisfies:
|
||||
- f(arg3) = arg0
|
||||
- f(arg4) = arg1
|
||||
- f'(arg3) = f'(arg4) = 0"
|
||||
(+ arg0 (* (- arg1 arg0) (smooth-step (/ (- arg2 arg3) (- arg4 arg3)))))
|
||||
)
|
||||
|
||||
+20
-22
@@ -2,7 +2,6 @@
|
||||
(in-package goal)
|
||||
|
||||
;; definition for method 3 of type matrix
|
||||
;; INFO: this function exists in multiple non-identical object files
|
||||
(defmethod inspect ((this matrix))
|
||||
(format #t "[~8x] matrix~%" this)
|
||||
(format
|
||||
@@ -34,7 +33,6 @@
|
||||
)
|
||||
|
||||
;; definition for method 3 of type matrix3
|
||||
;; INFO: this function exists in multiple non-identical object files
|
||||
(defmethod inspect ((this matrix3))
|
||||
(format #t "[~8x] matrix3~%" this)
|
||||
(format #t "~T[~F] [~F] [~F]~%" (-> this vector 0 x) (-> this vector 0 y) (-> this vector 0 z))
|
||||
@@ -76,7 +74,7 @@
|
||||
;; definition for function matrix+!
|
||||
(defun matrix+! ((arg0 matrix) (arg1 matrix) (arg2 matrix))
|
||||
"Set dst = src1 + src2. It is okay for any arguments to be the same data.
|
||||
This is not an efficient implementation."
|
||||
This is not an efficient implementation."
|
||||
(dotimes (v1-0 16)
|
||||
(set! (-> arg0 data v1-0) (+ (-> arg1 data v1-0) (-> arg2 data v1-0)))
|
||||
)
|
||||
@@ -86,7 +84,7 @@ This is not an efficient implementation."
|
||||
;; definition for function matrix-!
|
||||
(defun matrix-! ((arg0 matrix) (arg1 matrix) (arg2 matrix))
|
||||
"Set dst = src1 - src1. It is okay for any arugments to be the same data.
|
||||
This is not an efficient implementation."
|
||||
This is not an efficient implementation."
|
||||
(dotimes (v1-0 16)
|
||||
(set! (-> arg0 data v1-0) (- (-> arg1 data v1-0) (-> arg2 data v1-0)))
|
||||
)
|
||||
@@ -96,7 +94,7 @@ This is not an efficient implementation."
|
||||
;; definition for function matrix*!
|
||||
(defun matrix*! ((arg0 matrix) (arg1 matrix) (arg2 matrix))
|
||||
"Set dst = src1 * src2. It is okay for any arguments to be the same data.
|
||||
This is a moderately efficient implementation."
|
||||
This is a moderately efficient implementation."
|
||||
(rlet ((acc :class vf)
|
||||
(vf10 :class vf)
|
||||
(vf11 :class vf)
|
||||
@@ -147,8 +145,8 @@ This is a moderately efficient implementation."
|
||||
;; INFO: Used lq/sq
|
||||
(defun matrixp*! ((arg0 matrix) (arg1 matrix) (arg2 matrix))
|
||||
"Set dst = src1 * src2. NOTE: this function is a wrapper around matrix*!
|
||||
that adds no additional functionality. It seems to be a leftover from
|
||||
a time when matrix*! wasn't safe to use in place. This is unused."
|
||||
that adds no additional functionality. It seems to be a leftover from
|
||||
a time when matrix*! wasn't safe to use in place. This is unused."
|
||||
(let ((s5-0 (new-stack-matrix0)))
|
||||
(matrix*! s5-0 arg1 arg2)
|
||||
(set! (-> arg0 quad 0) (-> s5-0 quad 0))
|
||||
@@ -215,7 +213,7 @@ a time when matrix*! wasn't safe to use in place. This is unused."
|
||||
;; INFO: Used lq/sq
|
||||
(defun vector3s-matrix*! ((arg0 vector3s) (arg1 vector3s) (arg2 matrix))
|
||||
"Set dst to be ([src 1.0] * mat).xyz. Doesn't touch the w of dst.
|
||||
dst and vec can be the same memory"
|
||||
dst and vec can be the same memory"
|
||||
(let ((s5-0 (new-stack-vector0)))
|
||||
(set-vector! s5-0 (-> arg1 x) (-> arg1 y) (-> arg1 z) 1.0)
|
||||
(vector-matrix*! s5-0 s5-0 arg2)
|
||||
@@ -230,7 +228,7 @@ dst and vec can be the same memory"
|
||||
;; INFO: Used lq/sq
|
||||
(defun vector3s-rotate*! ((arg0 vector3s) (arg1 vector3s) (arg2 matrix))
|
||||
"Set dst to vec rotated by the rotation in the homogeneous transform mat.
|
||||
mat should not have a scale/shear (the upper 3x3 should be a pure rotation)."
|
||||
mat should not have a scale/shear (the upper 3x3 should be a pure rotation)."
|
||||
(let ((s5-0 (new-stack-vector0)))
|
||||
(set-vector! s5-0 (-> arg1 x) (-> arg1 y) (-> arg1 z) 1.0)
|
||||
(vector-rotate*! s5-0 s5-0 arg2)
|
||||
@@ -283,7 +281,7 @@ mat should not have a scale/shear (the upper 3x3 should be a pure rotation)."
|
||||
;; definition for function matrix-inverse-of-rot-trans!
|
||||
(defun matrix-inverse-of-rot-trans! ((arg0 matrix) (arg1 matrix))
|
||||
"Set dst = src^-1, assuming src is a homogeneous tranform with only rotation/translation.
|
||||
NOTE: THIS FUNCTION REQUIRES dst != src"
|
||||
NOTE: THIS FUNCTION REQUIRES dst != src"
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
@@ -320,7 +318,7 @@ NOTE: THIS FUNCTION REQUIRES dst != src"
|
||||
;; ERROR: Bad vector register dependency: vf5
|
||||
(defun matrix-4x4-inverse! ((arg0 matrix) (arg1 matrix))
|
||||
"Invert a 4x4 matrix. This assumes that the input is a homogeneous transform.
|
||||
Src and dst can be the same."
|
||||
Src and dst can be the same."
|
||||
(rlet ((acc :class vf)
|
||||
(Q :class vf)
|
||||
(vf0 :class vf)
|
||||
@@ -484,7 +482,7 @@ Src and dst can be the same."
|
||||
;; INFO: Used lq/sq
|
||||
(defun matrix-translate+! ((arg0 matrix) (arg1 matrix) (arg2 vector))
|
||||
"Add the given translation to the translation of homogenous transform mat src
|
||||
and store in dst. It is okay for dst = src."
|
||||
and store in dst. It is okay for dst = src."
|
||||
(set! (-> arg0 trans x) (+ (-> arg1 trans x) (-> arg2 x)))
|
||||
(set! (-> arg0 trans y) (+ (-> arg1 trans y) (-> arg2 y)))
|
||||
(set! (-> arg0 trans z) (+ (-> arg1 trans z) (-> arg2 z)))
|
||||
@@ -500,7 +498,7 @@ and store in dst. It is okay for dst = src."
|
||||
;; INFO: Used lq/sq
|
||||
(defun matrix-scale! ((arg0 matrix) (arg1 vector))
|
||||
"Set dst to a homogenous transform with only a scale. The x,y,z components
|
||||
of scale become the x,y,z scaling factors"
|
||||
of scale become the x,y,z scaling factors"
|
||||
(set! (-> arg0 quad 0) (the-as uint128 0))
|
||||
(set! (-> arg0 quad 1) (the-as uint128 0))
|
||||
(set! (-> arg0 quad 2) (the-as uint128 0))
|
||||
@@ -515,8 +513,8 @@ of scale become the x,y,z scaling factors"
|
||||
;; definition for function scale-matrix!
|
||||
(defun scale-matrix! ((arg0 matrix) (arg1 vector) (arg2 matrix))
|
||||
"Scale an existing matrix. Okay for dst = src. The scaling is applied per row.
|
||||
This means the x component of scale is used to scale the first row of src.
|
||||
The w component of scale is used."
|
||||
This means the x component of scale is used to scale the first row of src.
|
||||
The w component of scale is used."
|
||||
(rlet ((vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
@@ -544,7 +542,7 @@ The w component of scale is used."
|
||||
;; INFO: Used lq/sq
|
||||
(defun matrix-inv-scale! ((arg0 matrix) (arg1 vector))
|
||||
"Set dst to a homogeneous transform with only a scale.
|
||||
The x,y,z components of scale are inverted and used as the x,y,z scaling factors"
|
||||
The x,y,z components of scale are inverted and used as the x,y,z scaling factors"
|
||||
(set! (-> arg0 quad 0) (the-as uint128 0))
|
||||
(set! (-> arg0 quad 1) (the-as uint128 0))
|
||||
(set! (-> arg0 quad 2) (the-as uint128 0))
|
||||
@@ -559,7 +557,7 @@ The x,y,z components of scale are inverted and used as the x,y,z scaling factors
|
||||
;; definition for function column-scale-matrix!
|
||||
(defun column-scale-matrix! ((arg0 matrix) (arg1 vector) (arg2 matrix))
|
||||
"Scale an existing matrix. Okay for dst = src. The scaling is applied column-wise.
|
||||
Meaning the x component of scale will scale the first column of src."
|
||||
Meaning the x component of scale will scale the first column of src."
|
||||
(rlet ((vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
@@ -768,7 +766,7 @@ Meaning the x component of scale will scale the first column of src."
|
||||
;; definition for function matrix-rotate-yxy!
|
||||
(defun matrix-rotate-yxy! ((arg0 matrix) (arg1 vector))
|
||||
"Rotate. I believe in yxy order? Compared to the other rotations, this one
|
||||
is quite a bit more optimized and avoid repeated trig operations."
|
||||
is quite a bit more optimized and avoid repeated trig operations."
|
||||
(let ((a2-0 (new 'stack-no-clear 'vector))
|
||||
(s5-0 (new 'stack-no-clear 'vector))
|
||||
(s4-0 (new 'stack-no-clear 'vector))
|
||||
@@ -1139,7 +1137,7 @@ is quite a bit more optimized and avoid repeated trig operations."
|
||||
;; definition for function matrix-3x3-inverse!
|
||||
(defun matrix-3x3-inverse! ((arg0 matrix) (arg1 matrix))
|
||||
"Compute the inverse of a 3x3 matrix. Not very efficient.
|
||||
Requires src != dst."
|
||||
Requires src != dst."
|
||||
(let ((f0-0 (matrix-3x3-determinant arg1)))
|
||||
(set! (-> arg0 vector 0 x)
|
||||
(/ (- (* (-> arg1 vector 1 y) (-> arg1 vector 2 z)) (* (-> arg1 vector 1 z) (-> arg1 vector 2 y))) f0-0)
|
||||
@@ -1175,7 +1173,7 @@ Requires src != dst."
|
||||
;; definition for function matrix-3x3-inverse-transpose!
|
||||
(defun matrix-3x3-inverse-transpose! ((arg0 matrix) (arg1 matrix))
|
||||
"Invert and transpose.
|
||||
Requires dst != src."
|
||||
Requires dst != src."
|
||||
(let ((f0-0 (matrix-3x3-determinant arg1)))
|
||||
(set! (-> arg0 vector 0 x)
|
||||
(/ (- (* (-> arg1 vector 1 y) (-> arg1 vector 2 z)) (* (-> arg1 vector 1 z) (-> arg1 vector 2 y))) f0-0)
|
||||
@@ -1371,7 +1369,7 @@ Requires dst != src."
|
||||
;; definition for function matrix-4x4-inverse-transpose!
|
||||
(defun matrix-4x4-inverse-transpose! ((arg0 matrix) (arg1 matrix))
|
||||
"Invert and transpose an entire 4x4. I think has no restrictions, other than dst != src. Unused.
|
||||
The answer is wrong. The determinant function is wrong."
|
||||
The answer is wrong. The determinant function is wrong."
|
||||
(let ((f0-0 (matrix-4x4-determinant arg1)))
|
||||
(let ((f9-0 (-> arg1 vector 1 y))
|
||||
(f2-0 (-> arg1 vector 1 z))
|
||||
@@ -1716,7 +1714,7 @@ The answer is wrong. The determinant function is wrong."
|
||||
;; INFO: Used lq/sq
|
||||
(defun matrix->quat ((arg0 matrix) (arg1 quaternion))
|
||||
"Convert matrix to quaternion, works for matrix with scale.
|
||||
unlike matrix->quaternion."
|
||||
unlike matrix->quaternion."
|
||||
(let ((s5-0 (new 'stack-no-clear 'matrix)))
|
||||
(let* ((a2-0 arg0)
|
||||
(v1-0 (-> a2-0 quad 0))
|
||||
|
||||
+10
-11
@@ -2,7 +2,6 @@
|
||||
(in-package goal)
|
||||
|
||||
;; definition for method 3 of type quaternion
|
||||
;; INFO: this function exists in multiple non-identical object files
|
||||
(defmethod inspect ((this quaternion))
|
||||
(format #t "[~8x] quaternion~%" this)
|
||||
(format #t "~T[~F] [~F] [~F] [~F]~%" (-> this x) (-> this y) (-> this z) (-> this w))
|
||||
@@ -184,8 +183,8 @@
|
||||
;; ERROR: Bad vector register dependency: vf2
|
||||
(defun quaternion-conjugate! ((arg0 quaternion) (arg1 quaternion))
|
||||
"Set arg0 to the conjugate of arg1 (negate only ijk).
|
||||
If arg1 is normalized, this is equivalent to the inverse
|
||||
NOTE: this gives you the inverse rotation."
|
||||
If arg1 is normalized, this is equivalent to the inverse
|
||||
NOTE: this gives you the inverse rotation."
|
||||
(rlet ((vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
)
|
||||
@@ -290,7 +289,7 @@ NOTE: this gives you the inverse rotation."
|
||||
;; ERROR: Bad vector register dependency: vf3
|
||||
(defun quaternion-inverse! ((arg0 quaternion) (arg1 quaternion))
|
||||
"Invert a quaternion. The inverse will satisfy q * q^-1 = identity, even if q is not normalized.
|
||||
If your quaternion is normalized, it is faster/more accurate to do quaternion-conjugate!"
|
||||
If your quaternion is normalized, it is faster/more accurate to do quaternion-conjugate!"
|
||||
(rlet ((acc :class vf)
|
||||
(Q :class vf)
|
||||
(vf0 :class vf)
|
||||
@@ -371,9 +370,9 @@ If your quaternion is normalized, it is faster/more accurate to do quaternion-co
|
||||
;; definition for function quaternion-right-mult-matrix!
|
||||
(defun quaternion-right-mult-matrix! ((arg0 matrix) (arg1 quaternion))
|
||||
"Place quaternion coefficients into a matrix.
|
||||
You can convert a quaternion to a matrix by taking the product of this
|
||||
right-mult and left-mult matrix, but this method is not used.
|
||||
Instead, quaternion->matrix is a more efficient implementation."
|
||||
You can convert a quaternion to a matrix by taking the product of this
|
||||
right-mult and left-mult matrix, but this method is not used.
|
||||
Instead, quaternion->matrix is a more efficient implementation."
|
||||
(let ((f3-0 (-> arg1 x))
|
||||
(f2-0 (-> arg1 y))
|
||||
(f1-0 (-> arg1 z))
|
||||
@@ -659,7 +658,7 @@ Instead, quaternion->matrix is a more efficient implementation."
|
||||
;; definition for function quaternion-slerp!
|
||||
(defun quaternion-slerp! ((arg0 quaternion) (arg1 quaternion) (arg2 quaternion) (arg3 float))
|
||||
"Real quaternion slerp. Spherical-linear interpolation is a nice way to interpolate
|
||||
between quaternions."
|
||||
between quaternions."
|
||||
(local-vars (v1-15 float))
|
||||
(rlet ((acc :class vf)
|
||||
(vf1 :class vf)
|
||||
@@ -725,8 +724,8 @@ between quaternions."
|
||||
;; definition for function quaternion-pseudo-slerp!
|
||||
(defun quaternion-pseudo-slerp! ((arg0 quaternion) (arg1 quaternion) (arg2 quaternion) (arg3 float))
|
||||
"This is a bad interpolation between quaternions. It lerps then normalizes.
|
||||
It will behave extremely poorly for 180 rotations.
|
||||
It is unused."
|
||||
It will behave extremely poorly for 180 rotations.
|
||||
It is unused."
|
||||
(rlet ((acc :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
@@ -760,7 +759,7 @@ It is unused."
|
||||
;; definition for function quaternion-pseudo-seek
|
||||
(defun quaternion-pseudo-seek ((arg0 quaternion) (arg1 quaternion) (arg2 quaternion) (arg3 float))
|
||||
"Seek one quaternion toward another. Not using real slerp, so this is only good if the quaternions
|
||||
are pretty similar."
|
||||
are pretty similar."
|
||||
(let ((s3-0 (new 'stack-no-clear 'quaternion)))
|
||||
(let ((s5-0 (new 'stack-no-clear 'quaternion)))
|
||||
(quaternion-copy! s3-0 arg2)
|
||||
|
||||
+2
-2
@@ -112,14 +112,14 @@ As a result, this type has a lot of weird methods and extra stuff hidden in it."
|
||||
;; definition for method 23 of type trsqv
|
||||
(defmethod global-y-angle-to-point ((this trsqv) (arg0 vector))
|
||||
"Get the angle in the xz plane from the position of this trsqv to the point arg0
|
||||
(ignores our current yaw)."
|
||||
(ignores our current yaw)."
|
||||
(vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)))
|
||||
)
|
||||
|
||||
;; definition for method 24 of type trsqv
|
||||
(defmethod relative-y-angle-to-point ((this trsqv) (arg0 vector))
|
||||
"Get the y angle between the current orientation and arg0
|
||||
(how much we'd have to yaw to point at arg0)."
|
||||
(how much we'd have to yaw to point at arg0)."
|
||||
(deg-diff (y-angle this) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans))))
|
||||
)
|
||||
|
||||
|
||||
+10
-10
@@ -15,7 +15,7 @@
|
||||
;; definition for function deg-
|
||||
(defun deg- ((arg0 float) (arg1 float))
|
||||
"Compute arg0-arg1, unwrapped, using rotation units.
|
||||
Result should be in the range (-180, 180)"
|
||||
Result should be in the range (-180, 180)"
|
||||
(the float (sar (- (shl (the int arg0) 48) (shl (the int arg1) 48)) 48))
|
||||
)
|
||||
|
||||
@@ -195,9 +195,9 @@ Result should be in the range (-180, 180)"
|
||||
;; definition for function vector-sin-rad!
|
||||
(defun vector-sin-rad! ((arg0 vector) (arg1 vector))
|
||||
"Taylor series approximation of sine on all 4 elements in a vector.
|
||||
Inputs should be in radians, in -pi to pi.
|
||||
Somehow their coefficients are a little bit off.
|
||||
Like the first coefficient, which should obviously be 1, is not quite 1."
|
||||
Inputs should be in radians, in -pi to pi.
|
||||
Somehow their coefficients are a little bit off.
|
||||
Like the first coefficient, which should obviously be 1, is not quite 1."
|
||||
(rlet ((acc :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf10 :class vf)
|
||||
@@ -239,7 +239,7 @@ Like the first coefficient, which should obviously be 1, is not quite 1."
|
||||
;; ERROR: Bad vector register dependency: vf2
|
||||
(defun vector-cos-rad! ((arg0 vector) (arg1 vector))
|
||||
"Compute the cosine of all 4 vector elements.
|
||||
Radians, with no wrapping. Uses taylor series with 4 coefficients."
|
||||
Radians, with no wrapping. Uses taylor series with 4 coefficients."
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
@@ -272,8 +272,8 @@ Radians, with no wrapping. Uses taylor series with 4 coefficients."
|
||||
;; ERROR: Bad vector register dependency: vf14
|
||||
(defun vector-sincos-rad! ((arg0 vector) (arg1 vector) (arg2 vector))
|
||||
"Compute the sine and cosine of each element of src, storing it in dst-sin and dst-cos.
|
||||
This is more efficient than separate calls to sin and cos.
|
||||
Inputs should be radians in -pi to pi."
|
||||
This is more efficient than separate calls to sin and cos.
|
||||
Inputs should be radians in -pi to pi."
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
@@ -331,7 +331,7 @@ Inputs should be radians in -pi to pi."
|
||||
;; WARN: Return type mismatch float vs none.
|
||||
(defun vector-rad<-vector-deg! ((out vector) (in vector))
|
||||
"Convert a vector in rotation units to radians, and unwrap.
|
||||
Input can be anything, output will be -2pi to pi."
|
||||
Input can be anything, output will be -2pi to pi."
|
||||
(local-vars (v0-0 float) (v1-1 uint128) (v1-2 uint128) (v1-3 uint128))
|
||||
(rlet ((vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
@@ -357,7 +357,7 @@ Input can be anything, output will be -2pi to pi."
|
||||
;; WARN: Return type mismatch float vs int.
|
||||
(defun vector-rad<-vector-deg/2! ((out vector) (in vector))
|
||||
"Divide the input by two, and then convert from rotation units to radians, unwrapping.
|
||||
Not sure why this really needs to be separate the from previous function..."
|
||||
Not sure why this really needs to be separate the from previous function..."
|
||||
(local-vars (v0-0 float) (v1-1 uint128) (v1-2 uint128) (v1-3 uint128))
|
||||
(rlet ((vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
@@ -438,7 +438,7 @@ Not sure why this really needs to be separate the from previous function..."
|
||||
;; definition for function sign
|
||||
(defun sign ((arg0 float))
|
||||
"Similar to above, but returns 0 if input is 0.
|
||||
But is more complicated."
|
||||
But is more complicated."
|
||||
(cond
|
||||
((< 0.0 arg0)
|
||||
1.0
|
||||
|
||||
+3
-3
@@ -978,8 +978,8 @@
|
||||
;; definition for function vector-dot
|
||||
(defun vector-dot ((arg0 vector) (arg1 vector))
|
||||
"Take the dot product of two vectors.
|
||||
Only does the x, y, z compoments.
|
||||
Originally handwritten assembly to space out loads and use FPU accumulator"
|
||||
Only does the x, y, z compoments.
|
||||
Originally handwritten assembly to space out loads and use FPU accumulator"
|
||||
(vector-dot arg0 arg1)
|
||||
)
|
||||
|
||||
@@ -1003,7 +1003,7 @@ Originally handwritten assembly to space out loads and use FPU accumulator"
|
||||
;; definition for function vector4-dot
|
||||
(defun vector4-dot ((arg0 vector) (arg1 vector))
|
||||
"Take the dot product of two vectors.
|
||||
Does the x, y, z, and w compoments"
|
||||
Does the x, y, z, and w compoments"
|
||||
(vector4-dot arg0 arg1)
|
||||
)
|
||||
|
||||
|
||||
+36
-36
@@ -111,7 +111,7 @@
|
||||
;; definition for function vector/!
|
||||
(defun vector/! ((arg0 vector) (arg1 vector) (arg2 vector))
|
||||
"Set arg0 = arg1 / arg2. The w component will be set to 1.
|
||||
The implementation is kind of crazy."
|
||||
The implementation is kind of crazy."
|
||||
(rlet ((Q :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
@@ -208,7 +208,7 @@ The implementation is kind of crazy."
|
||||
;; definition for function vector--float*!
|
||||
(defun vector--float*! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float))
|
||||
"Set arg0 = arg1 - (arg2 * arg3). The w component will be set to 1.
|
||||
Is this different from vector-*!"
|
||||
Is this different from vector-*!"
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
@@ -311,7 +311,7 @@ Is this different from vector-*!"
|
||||
;; definition for function vector-seek!
|
||||
(defun vector-seek! ((arg0 vector) (arg1 vector) (arg2 float))
|
||||
"Seek arg0 toward arg1. The arg0 is both read and written.
|
||||
arg2 is saturated to (0, 1)"
|
||||
arg2 is saturated to (0, 1)"
|
||||
(rlet ((vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
@@ -337,9 +337,9 @@ arg2 is saturated to (0, 1)"
|
||||
;; definition for function vector-smooth-seek!
|
||||
(defun vector-smooth-seek! ((arg0 vector) (arg1 vector) (arg2 float))
|
||||
"Smoothly seek vec toward target.
|
||||
The step always points toward the target and has length (dist * alpha).
|
||||
If the step is longer than max-step, the step is projected onto a _square_ with side length arg2.
|
||||
Note that this doesn't project to a circle like the function below..."
|
||||
The step always points toward the target and has length (dist * alpha).
|
||||
If the step is longer than max-step, the step is projected onto a _square_ with side length arg2.
|
||||
Note that this doesn't project to a circle like the function below..."
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
@@ -369,9 +369,9 @@ Note that this doesn't project to a circle like the function below..."
|
||||
;; definition for function vector-seek-2d-xz-smooth!
|
||||
(defun vector-seek-2d-xz-smooth! ((arg0 vector) (arg1 vector) (arg2 float) (arg3 float))
|
||||
"Smoothly seek vec's x and z components toward target.
|
||||
The step always points toward the target and has length (dist * alpha).
|
||||
If the step is longer than max-step, the step is projected onto a circle of radius max-step.
|
||||
Doesn't touch y or w."
|
||||
The step always points toward the target and has length (dist * alpha).
|
||||
If the step is longer than max-step, the step is projected onto a circle of radius max-step.
|
||||
Doesn't touch y or w."
|
||||
(let ((f0-1 (- (-> arg1 x) (-> arg0 x)))
|
||||
(f2-1 (- (-> arg1 z) (-> arg0 z)))
|
||||
)
|
||||
@@ -401,9 +401,9 @@ Doesn't touch y or w."
|
||||
;; definition for function vector-seek-2d-yz-smooth!
|
||||
(defun vector-seek-2d-yz-smooth! ((arg0 vector) (arg1 vector) (arg2 float) (arg3 float))
|
||||
"Smoothly seek vec's y and z components toward target.
|
||||
The step always points toward the target and has length (dist * alpha).
|
||||
If the step is longer than max-step, the step is projected onto a circle of radius max-step.
|
||||
Doesn't touch x or w."
|
||||
The step always points toward the target and has length (dist * alpha).
|
||||
If the step is longer than max-step, the step is projected onto a circle of radius max-step.
|
||||
Doesn't touch x or w."
|
||||
(let ((f0-1 (- (-> arg1 y) (-> arg0 y)))
|
||||
(f2-1 (- (-> arg1 z) (-> arg0 z)))
|
||||
)
|
||||
@@ -433,9 +433,9 @@ Doesn't touch x or w."
|
||||
;; definition for function vector-seek-3d-smooth!
|
||||
(defun vector-seek-3d-smooth! ((arg0 vector) (arg1 vector) (arg2 float) (arg3 float))
|
||||
"Smoothly seek vec's x, y, and z components toward target.
|
||||
The step always points toward the target and has length (dist * alpha).
|
||||
If the step is longer than max-step, the step is projected onto a circle of radius max-step.
|
||||
Doesn't touch w."
|
||||
The step always points toward the target and has length (dist * alpha).
|
||||
If the step is longer than max-step, the step is projected onto a circle of radius max-step.
|
||||
Doesn't touch w."
|
||||
(let ((f0-1 (- (-> arg1 x) (-> arg0 x)))
|
||||
(f1-2 (- (-> arg1 y) (-> arg0 y)))
|
||||
(f3-1 (- (-> arg1 z) (-> arg0 z)))
|
||||
@@ -469,8 +469,8 @@ Doesn't touch w."
|
||||
;; definition for function seek-with-smooth
|
||||
(defun seek-with-smooth ((arg0 float) (arg1 float) (arg2 float) (arg3 float) (arg4 float))
|
||||
"Move value closer to target.
|
||||
If we are within deadband, just go straight to target.
|
||||
If not, try to go alpha*err. If that is a larger step than max-step, limit to max-step"
|
||||
If we are within deadband, just go straight to target.
|
||||
If not, try to go alpha*err. If that is a larger step than max-step, limit to max-step"
|
||||
(let ((f0-1 (- arg1 arg0)))
|
||||
(cond
|
||||
((>= arg4 (fabs f0-1))
|
||||
@@ -526,7 +526,7 @@ If not, try to go alpha*err. If that is a larger step than max-step, limit to ma
|
||||
;; definition for function vector-v!
|
||||
(defun vector-v! ((arg0 vector))
|
||||
"Convert a velocity to a displacement per frame. The velocity should be in X/actual_second.
|
||||
Uses the current process clock."
|
||||
Uses the current process clock."
|
||||
(vector-float*! arg0 arg0 (seconds-per-frame))
|
||||
arg0
|
||||
)
|
||||
@@ -806,7 +806,7 @@ Uses the current process clock."
|
||||
;; definition for function vector-normalize-ret-len!
|
||||
(defun vector-normalize-ret-len! ((arg0 vector) (arg1 float))
|
||||
"Modify arg0 in place to have length arg1 for its xyz components.
|
||||
The w part isn't changed and the _original_ length is returned."
|
||||
The w part isn't changed and the _original_ length is returned."
|
||||
(local-vars (v1-1 float))
|
||||
(rlet ((acc :class vf)
|
||||
(Q :class vf)
|
||||
@@ -843,8 +843,8 @@ The w part isn't changed and the _original_ length is returned."
|
||||
;; INFO: Used lq/sq
|
||||
(defun vector-normalize-copy! ((arg0 vector) (arg1 vector) (arg2 float))
|
||||
"Normalize, but not in place.
|
||||
This implementation is very good compared to the vector-normalize! one.
|
||||
The w component is set to 1."
|
||||
This implementation is very good compared to the vector-normalize! one.
|
||||
The w component is set to 1."
|
||||
(let ((f0-0 (vector-length arg1)))
|
||||
(cond
|
||||
((= f0-0 0.0)
|
||||
@@ -906,8 +906,8 @@ The w component is set to 1."
|
||||
;; definition for function vector-length-max!
|
||||
(defun vector-length-max! ((arg0 vector) (arg1 float))
|
||||
"Make vector at most arg1 length (xyz only).
|
||||
If it is larger, project onto sphere.
|
||||
Doesn't touch w"
|
||||
If it is larger, project onto sphere.
|
||||
Doesn't touch w"
|
||||
(let ((f0-0 (vector-length arg0)))
|
||||
(when (not (or (= f0-0 0.0) (< f0-0 arg1)))
|
||||
(let ((f0-1 (/ f0-0 arg1)))
|
||||
@@ -925,8 +925,8 @@ Doesn't touch w"
|
||||
;; definition for function vector-xz-length-max!
|
||||
(defun vector-xz-length-max! ((arg0 vector) (arg1 float))
|
||||
"Make vector at most arg1 length (xz only).
|
||||
It it is larger, project onto circle.
|
||||
Doesn't touch w or y."
|
||||
It it is larger, project onto circle.
|
||||
Doesn't touch w or y."
|
||||
(let* ((v1-0 arg0)
|
||||
(f0-4 (sqrtf (+ (* (-> v1-0 x) (-> v1-0 x)) (* (-> v1-0 z) (-> v1-0 z)))))
|
||||
)
|
||||
@@ -1046,7 +1046,7 @@ Doesn't touch w or y."
|
||||
;; definition for function rot-zxy-from-vector!
|
||||
(defun rot-zxy-from-vector! ((arg0 vector) (arg1 vector))
|
||||
"I think this gives you a vector of euler angles to rotate some unit vector
|
||||
to arg1."
|
||||
to arg1."
|
||||
(let* ((f28-0 (-> arg1 z))
|
||||
(f30-0 (-> arg1 x))
|
||||
(f0-0 (atan f30-0 f28-0))
|
||||
@@ -1065,7 +1065,7 @@ to arg1."
|
||||
;; definition for function rot-zyx-from-vector!
|
||||
(defun rot-zyx-from-vector! ((arg0 vector) (arg1 vector))
|
||||
"I think this gives you a vector of euler angles to rotate some unit vector
|
||||
to arg1."
|
||||
to arg1."
|
||||
(let* ((f28-0 (-> arg1 z))
|
||||
(f30-0 (- (-> arg1 y)))
|
||||
(f0-1 (atan f30-0 f28-0))
|
||||
@@ -1084,7 +1084,7 @@ to arg1."
|
||||
;; definition for function vector-lerp!
|
||||
(defun vector-lerp! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float))
|
||||
"Linearly interpolate between two vectors. Alpha isn't clamped.
|
||||
w will be set to 1."
|
||||
w will be set to 1."
|
||||
(rlet ((vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
@@ -1108,7 +1108,7 @@ w will be set to 1."
|
||||
;; INFO: Used lq/sq
|
||||
(defun vector-lerp-clamp! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float))
|
||||
"Linearly interpolate between two vectors, clamping alpha to 0, 1.
|
||||
w will be set to 1."
|
||||
w will be set to 1."
|
||||
(rlet ((vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
@@ -1203,9 +1203,9 @@ w will be set to 1."
|
||||
;; INFO: Used lq/sq
|
||||
(defun vector-degi ((arg0 vector) (arg1 vector))
|
||||
"Convert a vector (in _rotations_) to degrees units, stored in an int.
|
||||
Truncates to the nearest _rotation_.
|
||||
Neither the input or output is a commonly used form.
|
||||
Unsurprisingly, this strange function is never used."
|
||||
Truncates to the nearest _rotation_.
|
||||
Neither the input or output is a commonly used form.
|
||||
Unsurprisingly, this strange function is never used."
|
||||
(local-vars (v1-0 uint128) (v1-1 uint128))
|
||||
(rlet ((vf1 :class vf))
|
||||
(.lvf vf1 (&-> arg1 quad))
|
||||
@@ -1221,8 +1221,8 @@ Unsurprisingly, this strange function is never used."
|
||||
;; INFO: Used lq/sq
|
||||
(defun vector-degf ((arg0 vector) (arg1 vector))
|
||||
"Convert a vector (in integer degree units) to floating point rotations.
|
||||
Truncates to the nearest _rotation_.
|
||||
Like the previous function, this is stupid and unused."
|
||||
Truncates to the nearest _rotation_.
|
||||
Like the previous function, this is stupid and unused."
|
||||
(local-vars (v1-1 uint128))
|
||||
(rlet ((vf1 :class vf))
|
||||
(let ((v1-0 (-> arg1 quad)))
|
||||
@@ -1238,7 +1238,7 @@ Like the previous function, this is stupid and unused."
|
||||
;; definition for function vector-degmod
|
||||
(defun vector-degmod ((arg0 vector) (arg1 vector))
|
||||
"This one is actually right. Wraps degrees units (in floats, like they should be)
|
||||
to +/- half a rotation."
|
||||
to +/- half a rotation."
|
||||
(local-vars (v1-0 uint128) (v1-1 uint128) (v1-2 uint128))
|
||||
(rlet ((vf1 :class vf))
|
||||
(.lvf vf1 (&-> arg1 quad))
|
||||
@@ -1617,7 +1617,7 @@ to +/- half a rotation."
|
||||
;; definition for function rand-vu-sphere-point!
|
||||
(defun rand-vu-sphere-point! ((arg0 vector) (arg1 float))
|
||||
"Get a random point on the sphere at the origin with radius arg1.
|
||||
The point is on the surface of the sphere."
|
||||
The point is on the surface of the sphere."
|
||||
(set-vector!
|
||||
arg0
|
||||
(rand-vu-float-range -1.0 1.0)
|
||||
|
||||
+5
-5
@@ -222,10 +222,10 @@
|
||||
;; WARN: Function get-nav-control has a return type of none, but the expression builder found a return statement.
|
||||
(defun get-nav-control ((arg0 process-drawable) (arg1 nav-mesh))
|
||||
"Given a [[process-drawable]] get the associated [[nav-control]] using either:
|
||||
- the provided `nav-mesh` arg
|
||||
- the `nav-mesh` associated with the [[process-drawable]]'s [[entity]]
|
||||
If no [[nav-mesh]] is set or found, set the [[entity]]'s [[entity-perm-status]] to TODO and return an error.
|
||||
Note that this doesn't actually return the nav-control, but instead adds this process-drawable to the nav-mesh."
|
||||
- the provided `nav-mesh` arg
|
||||
- the `nav-mesh` associated with the [[process-drawable]]'s [[entity]]
|
||||
If no [[nav-mesh]] is set or found, set the [[entity]]'s [[entity-perm-status]] to TODO and return an error.
|
||||
Note that this doesn't actually return the nav-control, but instead adds this process-drawable to the nav-mesh."
|
||||
(if (not arg1)
|
||||
(set! arg1 (nav-mesh-from-res-tag (-> arg0 entity) 'nav-mesh-actor 0))
|
||||
)
|
||||
@@ -397,7 +397,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defun add-nav-sphere ((nav nav-control) (sphere sphere) (max-spheres int))
|
||||
"Adds the given [[sphere]] to the [[nav-control]]'s `sphere-array` so long as
|
||||
`max-spheres` is less than [[nav-control]]'s `sphere-count`"
|
||||
`max-spheres` is less than [[nav-control]]'s `sphere-count`"
|
||||
(local-vars (a2-4 float))
|
||||
(rlet ((vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
|
||||
+14
-14
@@ -25,7 +25,7 @@
|
||||
;; definition for method 74 of type nav-enemy
|
||||
(defmethod general-event-handler ((this nav-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
||||
"Handles various events for the enemy
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
(case arg2
|
||||
(('nav-mesh-kill)
|
||||
(deactivate this)
|
||||
@@ -207,9 +207,9 @@
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod common-post ((self nav-enemy))
|
||||
"Does a lot of various things relating to interacting with the target
|
||||
- tracks when the enemy was last drawn
|
||||
- looks at the target and handles attacking
|
||||
@TODO Not extremely well understood yet"
|
||||
- tracks when the enemy was last drawn
|
||||
- looks at the target and handles attacking
|
||||
@TODO Not extremely well understood yet"
|
||||
(if (and (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-control-status on-screen)))
|
||||
(set-time! (-> self last-draw-time))
|
||||
)
|
||||
@@ -968,10 +968,10 @@
|
||||
;; definition for method 98 of type nav-enemy
|
||||
(defmethod in-aggro-range? ((this nav-enemy) (arg0 process-focusable) (arg1 vector))
|
||||
"Should the enemy activate.
|
||||
- if `activate-distance` is `0.0`, always true
|
||||
- otherwise, check if the provided process is close enough
|
||||
@param proc The process used to distance check
|
||||
@returns true/false"
|
||||
- if `activate-distance` is `0.0`, always true
|
||||
- otherwise, check if the provided process is close enough
|
||||
@param proc The process used to distance check
|
||||
@returns true/false"
|
||||
(if (and arg0 (not arg1))
|
||||
(set! arg1 (get-trans arg0 1))
|
||||
)
|
||||
@@ -1120,7 +1120,7 @@
|
||||
;; WARN: Return type mismatch float vs none.
|
||||
(defmethod set-enemy-info! ((this nav-enemy) (arg0 nav-enemy-info))
|
||||
"In addition to setting the `enemy-info`, also init the `neck-joint` if applicable from it
|
||||
@param info Set `enemy-info` accordingly"
|
||||
@param info Set `enemy-info` accordingly"
|
||||
(set! (-> this enemy-info) arg0)
|
||||
(set! (-> arg0 callback-info) *nav-enemy-callback-info*)
|
||||
(when (and (!= (-> this enemy-info neck-joint) -1) (zero? (-> this neck)))
|
||||
@@ -1315,11 +1315,11 @@
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod init-from-entity! ((this nav-enemy) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(init-enemy-collision! this)
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(init-enemy! this)
|
||||
|
||||
+5
-5
@@ -1099,11 +1099,11 @@
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod init-from-entity! ((this rigid-body-object) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(allocate-and-init-cshape this)
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(init-skel-and-rigid-body this)
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@
|
||||
;; definition for method 10 of type focus
|
||||
(defmethod collide-check? ((this focus) (proc process-focusable))
|
||||
"If the focused process is not dead,
|
||||
check that the [[collide-spec]] of the focus and the process match."
|
||||
check that the [[collide-spec]] of the focus and the process match."
|
||||
(when (and proc (not (logtest? (-> proc focus-status) (focus-status disable dead))))
|
||||
(let* ((root (-> proc root))
|
||||
(cshape (if (type? root collide-shape)
|
||||
|
||||
+8
-8
@@ -14,8 +14,8 @@
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defbehavior process-taskable-anim-loop process-taskable ((arg0 (function process-taskable object)))
|
||||
"Takes in a function and loops as long as it's return value is truthy
|
||||
Seen take in - `true-func` which takes no args TODO - seems fishy
|
||||
- a `(process-taskable process) lambda"
|
||||
Seen take in - `true-func` which takes no args TODO - seems fishy
|
||||
- a `(process-taskable process) lambda"
|
||||
(while (arg0 self)
|
||||
(let ((s5-0 (get-art-elem self)))
|
||||
(when (!= (ja-group) s5-0)
|
||||
@@ -42,7 +42,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy
|
||||
;; WARN: Return type mismatch art-joint-anim vs art-element.
|
||||
(defmethod get-art-elem ((this process-taskable))
|
||||
"Checks various things such the current actor, task status, etc to determine the right art-group data to use
|
||||
@returns the appropriate [[art-element]] for the given NPC"
|
||||
@returns the appropriate [[art-element]] for the given NPC"
|
||||
(the-as art-element (if (> (-> this skel active-channels) 0)
|
||||
(-> this skel root-channel 0 frame-group)
|
||||
)
|
||||
@@ -430,11 +430,11 @@ Seen take in - `true-func` which takes no args TODO - seems fishy
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this process-taskable) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(stack-size-set! (-> this main-thread) 512)
|
||||
(process-taskable-method-31 this)
|
||||
(process-drawable-from-entity! this arg0)
|
||||
|
||||
+4
-4
@@ -222,7 +222,7 @@ It's 32 bytes + type tag (ignored by C kernel)."
|
||||
;; definition for method 0 of type cpad-list
|
||||
(defmethod new cpad-list ((allocation symbol) (type-to-make type))
|
||||
"Create a cpad-list for 2 controllers. It's fine to do this even if one or both controllers
|
||||
aren't connected yet."
|
||||
aren't connected yet."
|
||||
(let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
|
||||
(set! (-> gp-0 num-cpads) 2)
|
||||
(set! (-> gp-0 cpads 0) (new 'global 'cpad-info 0))
|
||||
@@ -234,9 +234,9 @@ aren't connected yet."
|
||||
;; definition for function analog-input
|
||||
(defun analog-input ((arg0 int) (arg1 float) (arg2 float) (arg3 float) (arg4 float))
|
||||
"Convert integer input from pad into a float between -out-range and +out-range.
|
||||
The offset is applied directly to the input.
|
||||
The center val is the expected value for 0, after applying offset.
|
||||
The max val is the expected value with the stick pushed all the way."
|
||||
The offset is applied directly to the input.
|
||||
The center val is the expected value for 0, after applying offset.
|
||||
The max val is the expected value with the stick pushed all the way."
|
||||
(let* ((f1-1 (- (the float arg0) arg1))
|
||||
(f0-3 (- (fabs f1-1) arg2))
|
||||
(v1-0 (- arg3 arg2))
|
||||
|
||||
+3
-3
@@ -114,8 +114,8 @@
|
||||
;; ERROR: Unsupported inline assembly instruction kind - [mfc0 a1, Count]
|
||||
(defun stopwatch-end ((arg0 stopwatch))
|
||||
"End a stopwatch level. Stops the stopwatch if it's back to level zero.
|
||||
There is no guard against ending a stopwatch too many times, and a negative level
|
||||
will cause errors!"
|
||||
There is no guard against ending a stopwatch too many times, and a negative level
|
||||
will cause errors!"
|
||||
(local-vars (a1-0 int))
|
||||
(+! (-> arg0 begin-level) -1)
|
||||
(when (zero? (-> arg0 begin-level))
|
||||
@@ -180,7 +180,7 @@ will cause errors!"
|
||||
;; definition for method 10 of type clock
|
||||
(defmethod advance-by! ((this clock) (arg0 float))
|
||||
"Advance the clock by arg0 timeframes (as a float).
|
||||
Both counters keep a separate fractional and integer counter."
|
||||
Both counters keep a separate fractional and integer counter."
|
||||
(the int (+ arg0 (-> this accum)))
|
||||
(+! (-> this integral-accum) arg0)
|
||||
(set! (-> this old-integral-frame-counter) (-> this integral-frame-counter))
|
||||
|
||||
+2
-2
@@ -715,8 +715,8 @@
|
||||
;; INFO: Used lq/sq
|
||||
(defbehavior sound-play-by-name process-drawable ((arg0 sound-name) (arg1 sound-id) (arg2 int) (arg3 int) (arg4 int) (arg5 sound-group) (arg6 object))
|
||||
"Send play rpc to play a sound!
|
||||
Last arg can by a symbol with value [[#t]], in which case it will pull `trans` [[vector]] off the current [[process-drawable]]
|
||||
otherwise, an explicit [[vector]] can be provided"
|
||||
Last arg can by a symbol with value [[#t]], in which case it will pull `trans` [[vector]] off the current [[process-drawable]]
|
||||
otherwise, an explicit [[vector]] can be provided"
|
||||
(local-vars (sv-16 sound-group))
|
||||
(set! sv-16 arg5)
|
||||
(let ((s4-0 arg6))
|
||||
|
||||
+1
-1
@@ -140,7 +140,7 @@
|
||||
;; definition for method 10 of type carry-info
|
||||
(defmethod distance-from-destination ((this carry-info) (arg0 carry-info))
|
||||
"Returns the distance from the current `point` and the provided [[carry-info]]'s `point`.
|
||||
Returns `-1.0` if it exceeds the maximum allowed"
|
||||
Returns `-1.0` if it exceeds the maximum allowed"
|
||||
(let* ((f28-0 (vector-y-angle (vector-! (new 'stack-no-clear 'vector) (-> arg0 point) (-> this point))))
|
||||
(f30-0 (fabs (deg-diff f28-0 (vector-y-angle (-> this normal)))))
|
||||
(f28-1 (fabs (deg-diff (+ 32768.0 f28-0) (vector-y-angle (-> arg0 normal)))))
|
||||
|
||||
+3
-3
@@ -230,9 +230,9 @@
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod common-post ((this grunt-mech))
|
||||
"Does a lot of various things relating to interacting with the target
|
||||
- tracks when the enemy was last drawn
|
||||
- looks at the target and handles attacking
|
||||
@TODO Not extremely well understood yet"
|
||||
- tracks when the enemy was last drawn
|
||||
- looks at the target and handles attacking
|
||||
@TODO Not extremely well understood yet"
|
||||
((method-of-type grunt common-post) this)
|
||||
0
|
||||
(none)
|
||||
|
||||
+5
-5
@@ -382,11 +382,11 @@
|
||||
;; definition for method 11 of type mech
|
||||
(defmethod init-from-entity! ((this mech) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(mech-init arg0 (the-as matrix3 #f) (the-as handle #f) 100.0)
|
||||
(none)
|
||||
)
|
||||
|
||||
+5
-5
@@ -1161,11 +1161,11 @@
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this slide-control) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(set! (-> this root) (new 'process 'trsqv))
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(logclear! (-> this mask) (process-mask actor-pause))
|
||||
|
||||
+5
-5
@@ -2227,11 +2227,11 @@
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this base-turret) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(turret-init! this arg0 (the-as matrix #f))
|
||||
(go (method-of-object this idle))
|
||||
(none)
|
||||
|
||||
+3
-3
@@ -1177,9 +1177,9 @@
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod run-pending-updates! ((this engine-minimap) (arg0 time-frame))
|
||||
"Run updates if they scheduled. If something is found that has no pending update, kill it.
|
||||
Note that we won't kill things on this call if they fail to update their `update-time`.
|
||||
They will survive until the next call to `run-pending-updates`!
|
||||
(or you can modify their `update-time` before that to prevent them from being killed.)"
|
||||
Note that we won't kill things on this call if they fail to update their `update-time`.
|
||||
They will survive until the next call to `run-pending-updates`!
|
||||
(or you can modify their `update-time` before that to prevent them from being killed.)"
|
||||
(let ((s2-0 (the-as (pointer connection-pers) (&-> this alive-list)))
|
||||
(s3-0 (-> this alive-list))
|
||||
)
|
||||
|
||||
+2
-2
@@ -5658,8 +5658,8 @@
|
||||
;; definition for function get-highscore-type
|
||||
(defun get-highscore-type ((highscore-index-arg int))
|
||||
"Given a highscore index, return it's type as a symbol
|
||||
@param highscore-index-arg something
|
||||
@returns The type, as as symbol. Either `'game` or `'race`"
|
||||
@param highscore-index-arg something
|
||||
@returns The type, as as symbol. Either `'game` or `'race`"
|
||||
(let ((highscore-type 'game))
|
||||
(let ((highscore-index highscore-index-arg))
|
||||
(cond
|
||||
|
||||
+3
-3
@@ -252,7 +252,7 @@
|
||||
;; WARN: Found some very strange gotos. Check result carefully, this is not well tested.
|
||||
(defun load-game-text-info ((arg0 string) (arg1 (pointer object)) (arg2 kheap))
|
||||
"Load text, if needed. txt-name is the group name, curr-text is the _symbol_ for
|
||||
the game-text-info, and heap is the heap to load to. The heap will be cleared."
|
||||
the game-text-info, and heap is the heap to load to. The heap will be cleared."
|
||||
(local-vars (v0-3 int) (sv-16 game-text-info) (sv-24 int) (sv-32 int) (sv-40 int))
|
||||
(set! sv-16 (the-as game-text-info (-> arg1 0)))
|
||||
(set! sv-24 (the-as int (-> *setting-control* user-current language)))
|
||||
@@ -330,8 +330,8 @@ the game-text-info, and heap is the heap to load to. The heap will be cleared."
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defun load-level-text-files ((arg0 int))
|
||||
"Load the text files needed for level idx.
|
||||
This function made more sense back when text files were split up, but in the end they put everything
|
||||
in a single text group and file."
|
||||
This function made more sense back when text files were split up, but in the end they put everything
|
||||
in a single text group and file."
|
||||
(if (or *level-text-file-load-flag* (>= arg0 0))
|
||||
(load-game-text-info "common" (&-> '*common-text* value) *common-text-heap*)
|
||||
)
|
||||
|
||||
+16
-16
@@ -250,7 +250,7 @@ This is the main vector type."
|
||||
;; WARN: Using new Jak 2 rtype-of
|
||||
(defun type? ((obj object) (desired-type type))
|
||||
"Return if the given object is an instance of the given type.
|
||||
Works on basics, bintegers, or symbols."
|
||||
Works on basics, bintegers, or symbols."
|
||||
(let ((v1-0 object)
|
||||
(a0-1 (rtype-of obj))
|
||||
)
|
||||
@@ -270,8 +270,8 @@ Works on basics, bintegers, or symbols."
|
||||
;; definition for function find-parent-method
|
||||
(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.
|
||||
This is used to implement call-parent-method."
|
||||
If it does not exist, return `nothing` function.
|
||||
This is used to implement call-parent-method."
|
||||
(local-vars (v0-0 function))
|
||||
(let ((v1-2 (-> typ method-table method-id)))
|
||||
(until (!= v0-0 v1-2)
|
||||
@@ -341,11 +341,11 @@ This is used to implement call-parent-method."
|
||||
;; definition for function member
|
||||
(defun member ((obj-to-find object) (list object))
|
||||
"See if the first argument is in the proper list of the second argument.
|
||||
Checked with simple equality.
|
||||
If so, return the list starting at the at point (a truthy value).
|
||||
Otherwise, return #f.
|
||||
(member 'b '(a b c)) -> (b c d).
|
||||
(member 'w '(a b c)) -> #f"
|
||||
Checked with simple equality.
|
||||
If so, return the list starting at the at point (a truthy value).
|
||||
Otherwise, return #f.
|
||||
(member 'b '(a b c)) -> (b c d).
|
||||
(member 'w '(a b c)) -> #f"
|
||||
(let ((v1-0 list))
|
||||
(while (not (or (null? v1-0) (= (car v1-0) obj-to-find)))
|
||||
(set! v1-0 (cdr v1-0))
|
||||
@@ -370,8 +370,8 @@ Otherwise, return #f.
|
||||
;; definition for function assoc
|
||||
(defun assoc ((key object) (assoc-list object))
|
||||
"Search an association list for given object. Return #f if not found, otherwise the element with matching car.
|
||||
(assoc 'a '((a . 1) (b . 2) (c . 3))) -> (a . 1)
|
||||
(assoc 'x '((a . 1) (b . 2) (c . 3))) -> #f"
|
||||
(assoc 'a '((a . 1) (b . 2) (c . 3))) -> (a . 1)
|
||||
(assoc 'x '((a . 1) (b . 2) (c . 3))) -> #f"
|
||||
(let ((v1-0 assoc-list))
|
||||
(while (not (or (null? v1-0) (= (car (car v1-0)) key)))
|
||||
(set! v1-0 (cdr v1-0))
|
||||
@@ -507,9 +507,9 @@ Otherwise, return #f.
|
||||
;; definition for function insert-cons!
|
||||
(defun insert-cons! ((new-obj object) (list object))
|
||||
"Update an association list to have the given (key . value) pair.
|
||||
If a previous value exists, it is deleted first.
|
||||
This function always allocates a pair through `cons` on the global heap, which can never be freed,
|
||||
so it should almost never be used at runtime."
|
||||
If a previous value exists, it is deleted first.
|
||||
This function always allocates a pair through `cons` on the global heap, which can never be freed,
|
||||
so it should almost never be used at runtime."
|
||||
(let ((a3-0 (delete-car! (car new-obj) list)))
|
||||
(cons new-obj a3-0)
|
||||
)
|
||||
@@ -518,8 +518,8 @@ so it should almost never be used at runtime."
|
||||
;; definition for function sort
|
||||
(defun sort ((list pair) (compare-func (function object object object)))
|
||||
"Sort a list using the given comparision function.
|
||||
The function can return a #t/#f value, or a positive/negative value.
|
||||
For example, you could use either `-` or `<` as functions to sort integers."
|
||||
The function can return a #t/#f value, or a positive/negative value.
|
||||
For example, you could use either `-` or `<` as functions to sort integers."
|
||||
(let ((s4-0 -1))
|
||||
(while (nonzero? s4-0)
|
||||
(set! s4-0 0)
|
||||
@@ -915,7 +915,7 @@ The stride is stored in the heap-base of the inline-array-class child class."
|
||||
;; definition for function mem-set32!
|
||||
(defun mem-set32! ((dst pointer) (word-count int) (value int))
|
||||
"Set memory to the given 32-bit value, repeated n times. (like C memset, but setting int32_t instead of char).
|
||||
Not an optimized implementation. Must be 4-byte aligned."
|
||||
Not an optimized implementation. Must be 4-byte aligned."
|
||||
(let ((v0-0 dst))
|
||||
(dotimes (v1-0 word-count)
|
||||
(set! (-> (the-as (pointer int32) dst)) value)
|
||||
|
||||
+1
-2
@@ -171,7 +171,7 @@
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defbehavior remove-exit process ()
|
||||
"Remove the top stack frame. If you have no other stack frames, you can use this before a `go`
|
||||
to skip the `exit` of the state you are currently in."
|
||||
to skip the `exit` of the state you are currently in."
|
||||
(if (-> self stack-frame-top)
|
||||
(set! (-> self stack-frame-top) (-> self stack-frame-top next))
|
||||
)
|
||||
@@ -642,7 +642,6 @@ to skip the `exit` of the state you are currently in."
|
||||
)
|
||||
|
||||
;; definition for method 3 of type dead-pool-heap
|
||||
;; INFO: this function exists in multiple non-identical object files
|
||||
(defmethod inspect ((this dead-pool-heap))
|
||||
(format #t "[~8x] ~A~%" this (-> this type))
|
||||
(format #t "~Tname: ~A~%" (-> this name))
|
||||
|
||||
+1
-1
@@ -218,7 +218,7 @@
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defun copyn-charp<-string ((dst (pointer uint8)) (src string) (len int))
|
||||
"Copy part of a string to a c-string. Writes null terminator, repeatedly, to reach the given length.
|
||||
If the source is longer than the length, the null terminator is still included."
|
||||
If the source is longer than the length, the null terminator is still included."
|
||||
(let ((v1-0 (-> src data)))
|
||||
(while (and (nonzero? (-> v1-0 0)) (< 1 len))
|
||||
(set! (-> dst 0) (-> v1-0 0))
|
||||
|
||||
+50
-50
@@ -144,11 +144,11 @@
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this piston) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(local-vars (sv-64 res-tag))
|
||||
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
|
||||
(let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
|
||||
@@ -327,11 +327,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this turbine) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(local-vars (sv-16 res-tag) (sv-32 res-tag))
|
||||
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
|
||||
(let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
|
||||
@@ -500,11 +500,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this liftcat) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(local-vars (sv-16 res-tag) (sv-32 res-tag))
|
||||
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
|
||||
(let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
|
||||
@@ -705,11 +705,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this atollrotpipe) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(local-vars (sv-16 res-tag))
|
||||
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
|
||||
(let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
|
||||
@@ -920,11 +920,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this slider) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player))))
|
||||
(let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
|
||||
(set! (-> v1-2 prim-core collide-as) (collide-spec obstacle))
|
||||
@@ -1101,11 +1101,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this atoll-windmill) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(logior! (-> this mask) (process-mask ambient))
|
||||
(let ((a1-1 (new 'stack-no-clear 'sync-info-params)))
|
||||
(let ((v1-2 0))
|
||||
@@ -1186,11 +1186,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this atoll-valve) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(logior! (-> this mask) (process-mask ambient))
|
||||
(set! (-> this root) (new 'process 'trsqv))
|
||||
(process-drawable-from-entity! this arg0)
|
||||
@@ -1243,11 +1243,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this atoll-hatch) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(logior! (-> this mask) (process-mask ambient))
|
||||
(set! (-> this root) (new 'process 'trsqv))
|
||||
(process-drawable-from-entity! this arg0)
|
||||
@@ -1326,11 +1326,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this atoll-hellcat) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
|
||||
(let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
|
||||
(set! (-> v1-2 prim-core collide-as) (collide-spec obstacle))
|
||||
@@ -1403,11 +1403,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this atoll-mar-symbol) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(set! (-> this root) (new 'process 'trsqv))
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(initialize-skeleton
|
||||
|
||||
+5
-5
@@ -1791,11 +1791,11 @@
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this atoll-tank) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(set! (-> this is-master?) #t)
|
||||
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
|
||||
(let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 9) 0)))
|
||||
|
||||
+4
-4
@@ -785,9 +785,9 @@
|
||||
;; definition for method 55 of type juicer
|
||||
(defmethod common-post ((this juicer))
|
||||
"Does a lot of various things relating to interacting with the target
|
||||
- tracks when the enemy was last drawn
|
||||
- looks at the target and handles attacking
|
||||
@TODO Not extremely well understood yet"
|
||||
- tracks when the enemy was last drawn
|
||||
- looks at the target and handles attacking
|
||||
@TODO Not extremely well understood yet"
|
||||
(let ((t9-0 (method-of-type nav-enemy common-post)))
|
||||
(t9-0 this)
|
||||
)
|
||||
@@ -821,7 +821,7 @@
|
||||
;; definition for method 74 of type juicer
|
||||
(defmethod general-event-handler ((this juicer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
||||
"Handles various events for the enemy
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
(case arg2
|
||||
(('hit-flinch)
|
||||
(cond
|
||||
|
||||
+15
-15
@@ -48,11 +48,11 @@
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this cboss-tractor) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(set! (-> this root) (new 'process 'trsqv))
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(initialize-skeleton
|
||||
@@ -139,7 +139,7 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod init-plat! ((this cboss-elevator))
|
||||
"Does any necessary initial platform setup.
|
||||
For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound."
|
||||
For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound."
|
||||
(set! (-> this sound-id) (new-sound-id))
|
||||
0
|
||||
(none)
|
||||
@@ -148,10 +148,10 @@ For example for an elevator pre-compute the distance between the first and last
|
||||
;; definition for method 43 of type cboss-elevator
|
||||
(defmethod move-between-points ((this cboss-elevator) (arg0 vector) (arg1 float) (arg2 float))
|
||||
"Move between two points on the elevator's path
|
||||
@param vec TODO not sure
|
||||
@param point-a The first point fetched from the elevator's path
|
||||
@param point-b The second point fetched from the path
|
||||
@see [[path-control]] and [[elevator]]"
|
||||
@param vec TODO not sure
|
||||
@param point-a The first point fetched from the elevator's path
|
||||
@param point-b The second point fetched from the path
|
||||
@see [[path-control]] and [[elevator]]"
|
||||
(let ((s4-0 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg1 'interp))
|
||||
(a0-3 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg2 'interp))
|
||||
(v1-3 (-> this root trans))
|
||||
@@ -806,9 +806,9 @@ For example for an elevator pre-compute the distance between the first and last
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod common-post ((this krew-boss-clone))
|
||||
"Does a lot of various things relating to interacting with the target
|
||||
- tracks when the enemy was last drawn
|
||||
- looks at the target and handles attacking
|
||||
@TODO Not extremely well understood yet"
|
||||
- tracks when the enemy was last drawn
|
||||
- looks at the target and handles attacking
|
||||
@TODO Not extremely well understood yet"
|
||||
(let ((t9-0 (method-of-type nav-enemy common-post)))
|
||||
(t9-0 this)
|
||||
)
|
||||
@@ -883,7 +883,7 @@ For example for an elevator pre-compute the distance between the first and last
|
||||
;; definition for method 74 of type krew-boss-clone
|
||||
(defmethod general-event-handler ((this krew-boss-clone) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
||||
"Handles various events for the enemy
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
(with-pp
|
||||
(case arg2
|
||||
(('touch 'bonk 'attack)
|
||||
@@ -2117,7 +2117,7 @@ For example for an elevator pre-compute the distance between the first and last
|
||||
;; WARN: disable def twice: 22. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare.
|
||||
(defmethod general-event-handler ((this krew-boss) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
||||
"Handles various events for the enemy
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
(case arg2
|
||||
(('track)
|
||||
(cond
|
||||
|
||||
+65
-65
@@ -60,11 +60,11 @@
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this cas-conveyor) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(local-vars (sv-16 res-tag))
|
||||
(reset-root! this)
|
||||
(set! (-> this path) (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f))
|
||||
@@ -401,11 +401,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this cas-conveyor-switch) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(local-vars (sv-16 res-tag))
|
||||
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
|
||||
(let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
|
||||
@@ -702,11 +702,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this cas-electric-fence) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
|
||||
(let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
|
||||
(set! (-> v1-2 prim-core collide-as) (collide-spec obstacle))
|
||||
@@ -920,10 +920,10 @@ This commonly includes things such as:
|
||||
;; definition for method 43 of type cas-elevator
|
||||
(defmethod move-between-points ((this cas-elevator) (arg0 vector) (arg1 float) (arg2 float))
|
||||
"Move between two points on the elevator's path
|
||||
@param vec TODO not sure
|
||||
@param point-a The first point fetched from the elevator's path
|
||||
@param point-b The second point fetched from the path
|
||||
@see [[path-control]] and [[elevator]]"
|
||||
@param vec TODO not sure
|
||||
@param point-a The first point fetched from the elevator's path
|
||||
@param point-b The second point fetched from the path
|
||||
@see [[path-control]] and [[elevator]]"
|
||||
(let ((s5-0 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg1 'interp))
|
||||
(a0-3 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg2 'interp))
|
||||
(v1-3 (-> this root trans))
|
||||
@@ -1045,7 +1045,7 @@ This commonly includes things such as:
|
||||
;; definition for method 33 of type cas-elevator
|
||||
(defmethod init-plat! ((this cas-elevator))
|
||||
"Does any necessary initial platform setup.
|
||||
For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound."
|
||||
For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound."
|
||||
(set! (-> this sound-id) (new-sound-id))
|
||||
(cas-elevator-method-49 this)
|
||||
(none)
|
||||
@@ -1378,11 +1378,11 @@ For example for an elevator pre-compute the distance between the first and last
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this cas-rot-bridge) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
|
||||
(let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 5) 0)))
|
||||
(set! (-> s4-0 total-prims) (the-as uint 6))
|
||||
@@ -1635,11 +1635,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this cas-switch) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(local-vars (sv-16 res-tag))
|
||||
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
|
||||
(let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0)))
|
||||
@@ -1864,11 +1864,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this cas-trapdoor) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
|
||||
(let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
|
||||
(set! (-> v1-2 prim-core collide-as) (collide-spec obstacle))
|
||||
@@ -1977,11 +1977,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this cas-chain-plat) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
|
||||
(let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
|
||||
(set! (-> v1-2 prim-core collide-as) (collide-spec obstacle))
|
||||
@@ -2114,11 +2114,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this cas-rot-blade) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
|
||||
(let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0)))
|
||||
(set! (-> s4-0 total-prims) (the-as uint 3))
|
||||
@@ -2239,11 +2239,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this cas-flag-a) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(set! (-> this root) (new 'process 'trsqv))
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(initialize-skeleton
|
||||
@@ -2302,11 +2302,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this cas-flag-b) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(set! (-> this root) (new 'process 'trsqv))
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(initialize-skeleton
|
||||
@@ -2690,11 +2690,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this cas-robot-door) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(local-vars (sv-16 res-tag) (sv-32 res-tag))
|
||||
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
|
||||
(let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
|
||||
@@ -2857,11 +2857,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this lightning-ball) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
|
||||
(let ((v1-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0))))
|
||||
(set! (-> v1-2 prim-core collide-as) (collide-spec obstacle))
|
||||
|
||||
+6
-6
@@ -39,10 +39,10 @@
|
||||
;; definition for method 43 of type cpad-elevator
|
||||
(defmethod move-between-points ((this cpad-elevator) (vec vector) (point-a float) (point-b float))
|
||||
"Move between two points on the elevator's path
|
||||
@param vec TODO not sure
|
||||
@param point-a The first point fetched from the elevator's path
|
||||
@param point-b The second point fetched from the path
|
||||
@see [[path-control]] and [[elevator]]"
|
||||
@param vec TODO not sure
|
||||
@param point-a The first point fetched from the elevator's path
|
||||
@param point-b The second point fetched from the path
|
||||
@see [[path-control]] and [[elevator]]"
|
||||
(let ((path-point-a (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) point-a 'interp))
|
||||
(path-point-b (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) point-b 'interp))
|
||||
(elevator-trans (-> this root trans))
|
||||
@@ -80,7 +80,7 @@
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod configure-collision ((this cpad-elevator) (collide-with-jak? symbol))
|
||||
"Appropriately sets the collision on the elevator
|
||||
@param collide-with-jak? If set, the elevator will collide with Jak"
|
||||
@param collide-with-jak? If set, the elevator will collide with Jak"
|
||||
(let ((prim (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1)))
|
||||
(cond
|
||||
(collide-with-jak?
|
||||
@@ -185,7 +185,7 @@
|
||||
;; WARN: Return type mismatch sound-id vs none.
|
||||
(defmethod init-plat! ((this cpad-elevator))
|
||||
"Does any necessary initial platform setup.
|
||||
For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound."
|
||||
For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound."
|
||||
(let ((last-path-index (+ (-> this path curve num-cverts) -1)))
|
||||
(calc-dist-between-points! this 0 last-path-index)
|
||||
(calc-dist-between-points! this last-path-index 0)
|
||||
|
||||
+1
-1
@@ -976,7 +976,7 @@
|
||||
;; INFO: Used lq/sq
|
||||
(defmethod general-event-handler ((this roboguard-level) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
||||
"Handles various events for the enemy
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
(case arg2
|
||||
(('attack)
|
||||
(cond
|
||||
|
||||
+4
-4
@@ -1267,9 +1267,9 @@
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod common-post ((this bombbot))
|
||||
"Does a lot of various things relating to interacting with the target
|
||||
- tracks when the enemy was last drawn
|
||||
- looks at the target and handles attacking
|
||||
@TODO Not extremely well understood yet"
|
||||
- tracks when the enemy was last drawn
|
||||
- looks at the target and handles attacking
|
||||
@TODO Not extremely well understood yet"
|
||||
(local-vars (sv-16 sparticle-launcher) (sv-20 sparticle-launcher))
|
||||
(let ((t9-0 (method-of-type nav-enemy common-post)))
|
||||
(t9-0 this)
|
||||
@@ -1395,7 +1395,7 @@
|
||||
;; INFO: Used lq/sq
|
||||
(defmethod general-event-handler ((this bombbot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
||||
"Handles various events for the enemy
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
(case arg2
|
||||
(('nav-mesh-kill)
|
||||
(change-to *default-nav-mesh* this)
|
||||
|
||||
+5
-5
@@ -1829,11 +1829,11 @@
|
||||
;; WARN: Return type mismatch entity-perm-status vs none.
|
||||
(defmethod init-from-entity! ((this bush-collect) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(process-entity-status! this (entity-perm-status dead) #t)
|
||||
(none)
|
||||
)
|
||||
|
||||
+1
-1
@@ -53,6 +53,6 @@ all initialized from static data."
|
||||
;; definition for function get-traffic-height
|
||||
(defun get-traffic-height ((arg0 vector))
|
||||
"@returns The value of [[xz-height-map::9]] using [[*traffic-height-map*]] and the [[vector]] provided
|
||||
@see [[xz-height-map::9]]"
|
||||
@see [[xz-height-map::9]]"
|
||||
(get-height-at-point *traffic-height-map* arg0)
|
||||
)
|
||||
|
||||
+10
-10
@@ -135,21 +135,21 @@
|
||||
;; definition for method 11 of type nav-branch
|
||||
(defmethod get-density ((this nav-branch))
|
||||
"TODO
|
||||
@returns `density * 0.0078125` - is this some kind of trick?"
|
||||
@returns `density * 0.0078125` - is this some kind of trick?"
|
||||
(* 0.0078125 (the float (-> this density)))
|
||||
)
|
||||
|
||||
;; definition for method 12 of type nav-branch
|
||||
(defmethod get-speed-limit ((this nav-branch))
|
||||
"TODO
|
||||
@returns `speed-limit * 1024.0`"
|
||||
@returns `speed-limit * 1024.0`"
|
||||
(* 1024.0 (the float (-> this speed-limit)))
|
||||
)
|
||||
|
||||
;; definition for method 13 of type nav-branch
|
||||
(defmethod get-width ((this nav-branch))
|
||||
"TODO
|
||||
@returns `width * 256.0`"
|
||||
@returns `width * 256.0`"
|
||||
(* 256.0 (the float (-> this width)))
|
||||
)
|
||||
|
||||
@@ -161,14 +161,14 @@
|
||||
;; definition for method 15 of type nav-branch
|
||||
(defmethod dest-node-id-at-max? ((this nav-branch))
|
||||
"@returns if `dest-node`'s `id` is equal to `#FFFF`
|
||||
@see [[nav-node]]"
|
||||
@see [[nav-node]]"
|
||||
(!= (-> this dest-node id) #xffff)
|
||||
)
|
||||
|
||||
;; definition for method 21 of type nav-node
|
||||
(defmethod get-radius ((this nav-node))
|
||||
"TODO
|
||||
@returns `radius * 1024.0"
|
||||
@returns `radius * 1024.0"
|
||||
(* 1024.0 (the float (-> this radius)))
|
||||
)
|
||||
|
||||
@@ -180,8 +180,8 @@
|
||||
;; definition for method 19 of type nav-node
|
||||
(defmethod calc-sine-and-cosine! ((this nav-node) (ret vector))
|
||||
"Computes the sine and cosine of the `angle`.
|
||||
@param! ret The result <cosine, 0.0, -(sine), 1.0>
|
||||
@returns Nothing, the result will be in `ret`"
|
||||
@param! ret The result <cosine, 0.0, -(sine), 1.0>
|
||||
@returns Nothing, the result will be in `ret`"
|
||||
(let ((angle (the float (-> this angle)))
|
||||
(sin-cos-result (new 'stack-no-clear 'vector))
|
||||
)
|
||||
@@ -198,7 +198,7 @@
|
||||
;; INFO: Used lq/sq
|
||||
(defmethod get-position ((this nav-node) (ret vector))
|
||||
"@param! ret The [[vector]] that is modified to hold the result
|
||||
@returns the `position` [[vector]] with a `w` component of `1.0`"
|
||||
@returns the `position` [[vector]] with a `w` component of `1.0`"
|
||||
(set! (-> ret quad) (-> this position quad))
|
||||
(set! (-> ret w) 1.0)
|
||||
ret
|
||||
@@ -314,8 +314,8 @@
|
||||
;; definition for method 41 of type nav-graph
|
||||
(defmethod node-at-idx ((this nav-graph) (idx int))
|
||||
"Get the `nav-node` at a given position.
|
||||
@param idx The position in the `node-array` to return
|
||||
@returns the [[nav-node]] if it can be found, otherwise return [[#f]]"
|
||||
@param idx The position in the `node-array` to return
|
||||
@returns the [[nav-node]] if it can be found, otherwise return [[#f]]"
|
||||
(let ((v0-0 (the-as nav-node #f)))
|
||||
(if (and (>= idx 0) (< idx (-> this node-count)))
|
||||
(set! v0-0 (-> this node-array idx))
|
||||
|
||||
+1
-1
@@ -1191,7 +1191,7 @@
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod patch-nodes ((this nav-graph))
|
||||
"Patch nodes. Node pointers are stored as indices into arrays to be allocated on the level heap
|
||||
and patched at runtime after loading."
|
||||
and patched at runtime after loading."
|
||||
(when (not (-> this patched))
|
||||
(set! (-> this patched) #t)
|
||||
(let ((s5-0 0))
|
||||
|
||||
+5
-5
@@ -80,11 +80,11 @@
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this searchlight) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(set! (-> this root) (new 'process 'trsqv))
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(logclear! (-> this mask) (process-mask actor-pause))
|
||||
|
||||
+5
-5
@@ -984,11 +984,11 @@
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this boat-manager) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(set! (-> this mesh) (nav-mesh-from-res-tag arg0 'nav-mesh-actor 0))
|
||||
(set! (-> this entity) arg0)
|
||||
(when (-> this mesh)
|
||||
|
||||
+50
-50
@@ -528,11 +528,11 @@
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this security-wall) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(ctywide-entity-hack)
|
||||
(set! (-> this breach) #f)
|
||||
(set! (-> this pass) (res-lump-value arg0 'pickup-type int :time -1000000000.0))
|
||||
@@ -1025,11 +1025,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this fruit-stand) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(fruit-stand-method-28 this)
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(initialize-skeleton
|
||||
@@ -2145,11 +2145,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this cty-guard-turret) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(local-vars (v1-23 handle))
|
||||
(with-pp
|
||||
(cty-guard-turret-method-32 this)
|
||||
@@ -2384,11 +2384,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this parking-spot) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(set! (-> this root) (new 'process 'trsqv))
|
||||
(set! (-> this minimap) #f)
|
||||
(set! (-> this vehicle) (the-as handle #f))
|
||||
@@ -2940,11 +2940,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this propa) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(propa-method-29 this)
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(ctywide-entity-hack)
|
||||
@@ -3006,11 +3006,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this baron-statue) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(set! (-> this root) (new 'process 'trsqv))
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(initialize-skeleton
|
||||
@@ -3955,11 +3955,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this burning-bush) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(burning-bush-method-30 this)
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(ctywide-entity-hack)
|
||||
@@ -4023,11 +4023,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this barons-ship-lores) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(when (demo?)
|
||||
(process-entity-status! this (entity-perm-status dead) #t)
|
||||
(go empty-state)
|
||||
@@ -4296,11 +4296,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this lurker-pipe-lid) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(lurker-pipe-lid-method-28 this)
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(ctywide-entity-hack)
|
||||
@@ -4477,11 +4477,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this ctyn-lamp) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(ctyn-lamp-method-29 this)
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(initialize-skeleton
|
||||
|
||||
+30
-30
@@ -1290,11 +1290,11 @@
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this farm-marrow) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(farm-marrow-method-29 this)
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(initialize-skeleton
|
||||
@@ -1564,11 +1564,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this farm-beetree) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(farm-beetree-method-29 this)
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(initialize-skeleton
|
||||
@@ -1834,11 +1834,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this farm-cabbage) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(farm-cabbage-method-29 this)
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(initialize-skeleton
|
||||
@@ -2091,11 +2091,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this farm-small-cabbage) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(farm-small-cabbage-method-29 this)
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(initialize-skeleton
|
||||
@@ -2392,11 +2392,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this farm-chilirots) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(farm-chilirots-method-29 this)
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(initialize-skeleton
|
||||
@@ -2517,11 +2517,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this farm-sprinkler-barrels) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(farm-sprinkler-barrels-method-28 this)
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(logclear! (-> this mask) (process-mask actor-pause))
|
||||
|
||||
+1
-1
@@ -219,7 +219,7 @@
|
||||
;; definition for method 74 of type yakow
|
||||
(defmethod general-event-handler ((this yakow) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
||||
"Handles various events for the enemy
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
(case arg2
|
||||
(('attack)
|
||||
(let ((v1-1 (the-as object (-> arg3 param 1))))
|
||||
|
||||
+5
-5
@@ -1210,11 +1210,11 @@
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this city-neon-praxis) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(set! (-> this root) (new 'process 'trsqv))
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(logclear! (-> this mask) (process-mask actor-pause enemy))
|
||||
|
||||
+7
-7
@@ -179,7 +179,7 @@
|
||||
;; definition for method 74 of type crocadog-escort
|
||||
(defmethod general-event-handler ((this crocadog-escort) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
||||
"Handles various events for the enemy
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
(case arg2
|
||||
(('attack)
|
||||
((method-of-type bot general-event-handler) this arg0 arg1 arg2 arg3)
|
||||
@@ -198,7 +198,7 @@
|
||||
;; definition for method 59 of type crocadog-escort
|
||||
(defmethod get-penetrate-info ((this crocadog-escort))
|
||||
"@returns the allowed way(s) this enemy can take damage
|
||||
@see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]"
|
||||
@see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]"
|
||||
(let ((v1-1 ((method-of-type bot get-penetrate-info) this)))
|
||||
(logior (penetrate jak-yellow-shot jak-red-shot jak-blue-shot) v1-1)
|
||||
)
|
||||
@@ -373,11 +373,11 @@
|
||||
;; definition for method 11 of type crocadog-escort
|
||||
(defmethod init-from-entity! ((this crocadog-escort) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(stack-size-set! (-> this main-thread) 512)
|
||||
((method-of-type bot init-from-entity!) this arg0)
|
||||
(none)
|
||||
|
||||
+1
-1
@@ -117,7 +117,7 @@
|
||||
;; definition for method 74 of type hal-escort
|
||||
(defmethod general-event-handler ((this hal-escort) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
||||
"Handles various events for the enemy
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
(case arg2
|
||||
(('notify)
|
||||
(case (-> arg3 param 0)
|
||||
|
||||
+7
-7
@@ -179,7 +179,7 @@
|
||||
;; definition for method 74 of type kid-escort
|
||||
(defmethod general-event-handler ((this kid-escort) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
||||
"Handles various events for the enemy
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
(case arg2
|
||||
(('arrest)
|
||||
(let* ((s4-0 (handle->process (-> this arrestor-handle)))
|
||||
@@ -372,11 +372,11 @@
|
||||
;; definition for method 11 of type kid-escort
|
||||
(defmethod init-from-entity! ((this kid-escort) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(stack-size-set! (-> this main-thread) 512)
|
||||
((method-of-type bot init-from-entity!) this arg0)
|
||||
(none)
|
||||
@@ -636,7 +636,7 @@ This commonly includes things such as:
|
||||
;; definition for method 59 of type kid-escort
|
||||
(defmethod get-penetrate-info ((this kid-escort))
|
||||
"@returns the allowed way(s) this enemy can take damage
|
||||
@see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]"
|
||||
@see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]"
|
||||
(let ((v1-1 ((method-of-type bot get-penetrate-info) this)))
|
||||
(logior (penetrate jak-yellow-shot jak-red-shot jak-blue-shot) v1-1)
|
||||
)
|
||||
|
||||
+12
-12
@@ -921,7 +921,7 @@
|
||||
;; definition for method 74 of type tanker-grunt
|
||||
(defmethod general-event-handler ((this tanker-grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
||||
"Handles various events for the enemy
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
(case arg2
|
||||
(('skip-intro)
|
||||
(when (and (-> this next-state)
|
||||
@@ -1039,7 +1039,7 @@
|
||||
;; definition for method 74 of type tanker-juicer
|
||||
(defmethod general-event-handler ((this tanker-juicer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
||||
"Handles various events for the enemy
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
(case arg2
|
||||
(('skip-intro)
|
||||
(when (and (-> this next-state) (let ((v1-4 (-> this next-state name)))
|
||||
@@ -1334,11 +1334,11 @@
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this tanker-container) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
|
||||
(let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0)))
|
||||
(set! (-> s4-0 total-prims) (the-as uint 4))
|
||||
@@ -1468,11 +1468,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this tanker-crash) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
|
||||
(let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0)))
|
||||
(set! (-> s4-0 total-prims) (the-as uint 4))
|
||||
|
||||
+25
-25
@@ -1139,11 +1139,11 @@
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this market-basket-a) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(let ((cshape (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
|
||||
(let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0))))
|
||||
(set! (-> prim-mesh prim-core collide-as) (collide-spec crate))
|
||||
@@ -1231,11 +1231,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this market-basket-b) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(let ((cshape (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
|
||||
(let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0))))
|
||||
(set! (-> prim-mesh prim-core collide-as) (collide-spec crate))
|
||||
@@ -1323,11 +1323,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this market-crate) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(let ((cshape (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
|
||||
(let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0))))
|
||||
(set! (-> prim-mesh prim-core collide-as) (collide-spec crate))
|
||||
@@ -1415,11 +1415,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this market-sack-a) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(let ((cshape (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
|
||||
(let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0))))
|
||||
(set! (-> prim-mesh prim-core collide-as) (collide-spec crate))
|
||||
@@ -1507,11 +1507,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this market-sack-b) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(let ((cshape (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
|
||||
(let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0))))
|
||||
(set! (-> prim-mesh prim-core collide-as) (collide-spec crate))
|
||||
|
||||
+1
-1
@@ -2126,7 +2126,7 @@
|
||||
;; INFO: Used lq/sq
|
||||
(defmethod general-event-handler ((this city-lurker) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
||||
"Handles various events for the enemy
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
(case arg2
|
||||
(('nav-mesh-kill)
|
||||
(format 0 "nav-mesh-kill event recieved by ~s ~d~%" (-> this name) arg2)
|
||||
|
||||
+1
-1
@@ -855,7 +855,7 @@
|
||||
;; definition for method 35 of type oracle-npc
|
||||
(defmethod get-art-elem ((this oracle-npc))
|
||||
"Checks various things such the current actor, task status, etc to determine the right art-group data to use
|
||||
@returns the appropriate [[art-element]] for the given NPC"
|
||||
@returns the appropriate [[art-element]] for the given NPC"
|
||||
(logior! (-> this draw status) (draw-control-status no-draw-bounds))
|
||||
(let ((root-prim (-> this root root-prim)))
|
||||
(set! (-> root-prim prim-core collide-as) (collide-spec))
|
||||
|
||||
+5
-5
@@ -106,11 +106,11 @@
|
||||
;; WARN: Return type mismatch entity-perm-status vs none.
|
||||
(defmethod init-from-entity! ((this krew-package) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(process-entity-status! this (entity-perm-status dead) #t)
|
||||
(none)
|
||||
)
|
||||
|
||||
+15
-15
@@ -98,11 +98,11 @@
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this palace-door) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
|
||||
(set! (-> s5-0 penetrated-by) (penetrate))
|
||||
(let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0)))
|
||||
@@ -209,11 +209,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this ctypal-broke-wall) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(format #t "~A initialising~%" (-> this name))
|
||||
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
|
||||
(let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
|
||||
@@ -294,11 +294,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this ctypal-baron-statue-broken) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(set! (-> this root) (new 'process 'trsqv))
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(initialize-skeleton
|
||||
|
||||
+10
-10
@@ -3646,11 +3646,11 @@
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this hiphog-exterior-marquee) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(set! (-> this root) (new 'process 'trsqv))
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(logclear! (-> this mask) (process-mask actor-pause enemy))
|
||||
@@ -3779,11 +3779,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this farthy) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(set! (-> this root) (new 'process 'trsqv))
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(set! (-> this root pause-adjust-distance) 1228800.0)
|
||||
|
||||
+5
-5
@@ -87,11 +87,11 @@
|
||||
;; WARN: Return type mismatch entity-perm-status vs none.
|
||||
(defmethod init-from-entity! ((this seal-of-mar) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(process-entity-status! this (entity-perm-status dead) #t)
|
||||
(none)
|
||||
)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user