mirror of
https://github.com/open-goal/jak-project
synced 2026-08-03 00:47:12 -04:00
[decomp] clean up files 50-100 (#1443)
* [decomp] clean up files 50-100 * update file, fix crash on too many prims * spelling is hard
This commit is contained in:
@@ -4021,6 +4021,24 @@ std::vector<Form*> cast_to_64_bit(const std::vector<Form*>& forms,
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
FormElement* try_make_nonzero_logtest(Form* in, FormPool& pool) {
|
||||
/*
|
||||
(defmacro logtest? (a b)
|
||||
"does a have any of the bits in b?"
|
||||
`(nonzero? (logand ,a ,b))
|
||||
)
|
||||
*/
|
||||
auto logand_matcher = Matcher::op(GenericOpMatcher::fixed(FixedOperatorKind::LOGAND),
|
||||
{Matcher::any(0), Matcher::any(1)});
|
||||
auto mr_logand = match(logand_matcher, in);
|
||||
if (mr_logand.matched) {
|
||||
return pool.alloc_element<GenericElement>(
|
||||
GenericOperator::make_fixed(FixedOperatorKind::LOGTEST), mr_logand.maps.forms.at(0),
|
||||
mr_logand.maps.forms.at(1));
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
FormElement* ConditionElement::make_zero_check_generic(const Env& env,
|
||||
@@ -4069,25 +4087,17 @@ FormElement* ConditionElement::make_zero_check_generic(const Env& env,
|
||||
std::vector<Form*>{source_forms.at(0), nice_constant});
|
||||
}
|
||||
|
||||
return pool.alloc_element<GenericElement>(GenericOperator::make_compare(m_kind), source_forms);
|
||||
}
|
||||
|
||||
FormElement* try_make_nonzero_logtest(Form* in, FormPool& pool) {
|
||||
/*
|
||||
(defmacro logtest? (a b)
|
||||
"does a have any of the bits in b?"
|
||||
`(nonzero? (logand ,a ,b))
|
||||
)
|
||||
*/
|
||||
auto logand_matcher = Matcher::op(GenericOpMatcher::fixed(FixedOperatorKind::LOGAND),
|
||||
{Matcher::any(0), Matcher::any(1)});
|
||||
auto mr_logand = match(logand_matcher, in);
|
||||
if (mr_logand.matched) {
|
||||
return pool.alloc_element<GenericElement>(
|
||||
GenericOperator::make_fixed(FixedOperatorKind::LOGTEST), mr_logand.maps.forms.at(0),
|
||||
mr_logand.maps.forms.at(1));
|
||||
auto as_logtest = try_make_nonzero_logtest(source_forms.at(0), pool);
|
||||
if (as_logtest) {
|
||||
auto logtest_form = pool.alloc_single_form(nullptr, as_logtest);
|
||||
auto not_form = pool.alloc_element<GenericElement>(
|
||||
GenericOperator::make_compare(IR2_Condition::Kind::FALSE), logtest_form);
|
||||
return not_form;
|
||||
}
|
||||
return nullptr;
|
||||
*/
|
||||
|
||||
return pool.alloc_element<GenericElement>(GenericOperator::make_compare(m_kind), source_forms);
|
||||
}
|
||||
|
||||
FormElement* try_make_logtest_cpad_macro(Form* in, FormPool& pool) {
|
||||
|
||||
@@ -6464,7 +6464,7 @@
|
||||
;; field param1 is a basic loaded with a signed load field param2 is a basic loaded with a signed load
|
||||
(:methods
|
||||
(new (symbol type basic) _type_ 0)
|
||||
(dummy-9 (_type_ basic) _type_ 9)
|
||||
(reset-and-assign-geo! (_type_ basic) _type_ 9)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -9177,42 +9177,16 @@
|
||||
(defenum shadow-flags
|
||||
:bitfield #t
|
||||
:type int32
|
||||
(shdf00)
|
||||
(shdf01)
|
||||
(shdf02)
|
||||
(shdf00) ;; unused
|
||||
(disable-fade)
|
||||
(shdf02) ;; only set, never used.
|
||||
(shdf03)
|
||||
(shdf04)
|
||||
(shdf05)
|
||||
(shdf06)
|
||||
(shdf07)
|
||||
(shdf08)
|
||||
(shdf09)
|
||||
(shdf10)
|
||||
(shdf11)
|
||||
(shdf12)
|
||||
(shdf13)
|
||||
(shdf14)
|
||||
(shdf15)
|
||||
(shdf16)
|
||||
(shdf17)
|
||||
(shdf18)
|
||||
(shdf19)
|
||||
(shdf20)
|
||||
(shdf21)
|
||||
(shdf22)
|
||||
(shdf23)
|
||||
(shdf24)
|
||||
(shdf25)
|
||||
(shdf26)
|
||||
(shdf27)
|
||||
(shdf28)
|
||||
(shdf29)
|
||||
(shdf30)
|
||||
(shdf31)
|
||||
(shdf04) ;; unused
|
||||
(disable-draw)
|
||||
)
|
||||
|
||||
(deftype shadow-settings (structure)
|
||||
((center vector :inline :offset-assert 0)
|
||||
((center vector :inline :offset-assert 0 :do-not-decompile)
|
||||
(flags shadow-flags :score 100 :offset 12)
|
||||
(shadow-dir vector :inline :offset-assert 16)
|
||||
(dist-to-locus float :offset 28)
|
||||
@@ -9241,7 +9215,7 @@
|
||||
(set-offset-bit (shadow-control) int 10)
|
||||
(set-top-plane-offset (shadow-control float) int 11)
|
||||
(set-bottom-plane-offset (shadow-control float) int 12)
|
||||
(dummy-13 (_type_) none 13)
|
||||
(unused-13 (_type_) none 13)
|
||||
(update-direction-from-time-of-day (_type_) none 14)
|
||||
(collide-to-find-planes (_type_ vector float float float) none 15)
|
||||
)
|
||||
@@ -9903,7 +9877,7 @@
|
||||
:flag-assert #xb000000c0
|
||||
(:methods
|
||||
(new (symbol type int) _type_ 0)
|
||||
(dummy-9 (_type_) float 9)
|
||||
(current-cycle-distance (_type_) float 9)
|
||||
(debug-print-channels (_type_ symbol) int 10)
|
||||
)
|
||||
)
|
||||
@@ -10221,38 +10195,33 @@
|
||||
(defenum surface-flags
|
||||
:bitfield #t
|
||||
:type uint32
|
||||
(surf00)
|
||||
(surf01)
|
||||
(surf02)
|
||||
(surf03)
|
||||
(surf04)
|
||||
(surf05)
|
||||
(surf06)
|
||||
(surf07)
|
||||
(surf08)
|
||||
(surf09)
|
||||
(surf10)
|
||||
(surf11)
|
||||
(surf12)
|
||||
(surf13)
|
||||
(surf14)
|
||||
(surf15)
|
||||
(surf16)
|
||||
(surf17)
|
||||
(surf18)
|
||||
(surf19)
|
||||
(surf20)
|
||||
(surf21)
|
||||
(surf22)
|
||||
(surf23)
|
||||
(surf24)
|
||||
(surf25)
|
||||
(surf26)
|
||||
(surf27)
|
||||
(surf28)
|
||||
(surf29)
|
||||
(surf30)
|
||||
(surf31)
|
||||
(allow-look-around) ;; allows entering first person with triangle
|
||||
(dive) ;; set on all diving (dive, dive-bottom) surfaces
|
||||
(surf02) ;; unused
|
||||
(no-turn-around) ;; prevent "changed direction" animation from happening
|
||||
|
||||
;; when jak is on a surface with this flag, the case where jak
|
||||
;; is forced to rotate in the direction he's traveling is
|
||||
;; never taken. It's used on ice (though it is not needed, the turn toward transv
|
||||
;; is disabled by not being in target-walk ever) and also used to prevent
|
||||
;; jak from spinning around when he shouldn't (like if he's knocked back)
|
||||
(no-rotate-toward-transv)
|
||||
;; if jak should always be forced to rotate in the direction he's travelling.
|
||||
;; used for the slides and also the warp gate jump
|
||||
(always-rotate-toward-transv)
|
||||
|
||||
;; never set, but prevents jak from jumping (both normal and roll)
|
||||
(prevent-jump)
|
||||
|
||||
;; target is launch jumping (from a blue eco pad)
|
||||
(prevent-attacks-during-launch-jump)
|
||||
(surf08) ;; never set, prevents various attacks from being possible
|
||||
(surf09) ;; another attack prevent
|
||||
(allow-edge-grab) ;; if set, and jak is falling, turn on the ledge grab search.
|
||||
(jump) ;; set on all jumps, used to prevent "on-grounds" in places
|
||||
(attacking) ;; set on all attacks, but not actually used anywhere
|
||||
(ducking) ;; set on all ducks, but not actually used anywhere
|
||||
(moving-ground) ;; unused, but would make sense if jak was on something moving
|
||||
)
|
||||
|
||||
(deftype surface (basic)
|
||||
@@ -10364,7 +10333,7 @@
|
||||
((skip uint8 :offset 0 :size 3 :do-not-decompile)
|
||||
(mode pat-mode :offset 3 :size 3)
|
||||
(material pat-material :offset 6 :size 6)
|
||||
(camera uint8 :offset 12 :size 2)
|
||||
(camera uint8 :offset 12 :size 2 :do-not-decompile)
|
||||
(event pat-event :offset 14 :size 6)
|
||||
(noentity uint8 :offset 0 :size 1)
|
||||
(nocamera uint8 :offset 1 :size 1)
|
||||
@@ -13046,7 +13015,7 @@
|
||||
(num-spheres uint32 :offset-assert 4)
|
||||
(collide-with collide-kind :offset-assert 8)
|
||||
(proc process-drawable :offset-assert 16)
|
||||
(ignore-pat uint32 :offset-assert 20) ;; flags / bitfield i bet
|
||||
(ignore-pat pat-surface :offset-assert 20) ;; flags / bitfield i bet
|
||||
(solid-only basic :offset-assert 24) ;; probably a symbol
|
||||
)
|
||||
:method-count-assert 9
|
||||
@@ -13146,15 +13115,15 @@
|
||||
:flag-assert #x2100008670
|
||||
(:methods
|
||||
(debug-draw (_type_) none 9)
|
||||
(fill-and-probe-using-line-sphere (_type_ vector vector float collide-kind process collide-tri-result int) float 10)
|
||||
(fill-and-probe-using-line-sphere (_type_ vector vector float collide-kind process collide-tri-result pat-surface) float 10)
|
||||
(fill-and-probe-using-spheres (_type_ collide-using-spheres-params) symbol 11)
|
||||
(fill-and-probe-using-y-probe (_type_ vector float collide-kind process-drawable collide-tri-result pat-surface) float 12)
|
||||
(fill-using-bounding-box (_type_ bounding-box collide-kind process-drawable pat-surface) none 13)
|
||||
(fill-using-line-sphere (_type_ vector vector float collide-kind process-drawable int) none 14)
|
||||
(fill-using-line-sphere (_type_ vector vector float collide-kind process-drawable pat-surface) none 14)
|
||||
(fill-using-spheres (_type_ collide-using-spheres-params) none 15)
|
||||
(fill-using-y-probe (_type_ vector float collide-kind process-drawable pat-surface) none 16)
|
||||
(initialize (_type_) none 17)
|
||||
(probe-using-line-sphere (_type_ vector vector float collide-kind collide-tri-result int) float 18)
|
||||
(probe-using-line-sphere (_type_ vector vector float collide-kind collide-tri-result pat-surface) float 18)
|
||||
(probe-using-spheres (_type_ collide-using-spheres-params) symbol 19)
|
||||
(probe-using-y-probe (_type_ vector float collide-kind collide-tri-result pat-surface) float 20)
|
||||
(fill-from-background (_type_ (function bsp-header int collide-list none) (function collide-cache object none)) none 21) ;; second functiom is method 28
|
||||
@@ -19703,11 +19672,11 @@
|
||||
(define-extern cam-collision-record-save (function vector vector int symbol camera-slave none))
|
||||
(define-extern cam-string-move (function object :behavior camera-slave))
|
||||
(define-extern cam-dist-analog-input (function int float float))
|
||||
(define-extern cam-los-collide (function vector vector clip-travel-vector-to-mesh-return-info int symbol :behavior camera-slave))
|
||||
(define-extern cam-los-collide (function vector vector clip-travel-vector-to-mesh-return-info pat-surface symbol :behavior camera-slave))
|
||||
(define-extern dist-info-init (function collide-los-dist-info none))
|
||||
(define-extern los-cw-ccw (function (inline-array collide-cache-tri) vector vector float clip-travel-vector-to-mesh-return-info vector float symbol))
|
||||
(define-extern cam-debug-add-los-tri (function (inline-array collide-cache-tri) vector vector none))
|
||||
(define-extern cam-los-spline-collide (function vector vector vector float))
|
||||
(define-extern cam-los-spline-collide (function vector vector pat-surface float))
|
||||
(define-extern cam-los-setup-lateral (function clip-travel-vector-to-mesh-return-info vector vector symbol :behavior camera-slave))
|
||||
(define-extern slave-los-state->string (function slave-los-state string))
|
||||
(define-extern dist-info-print (function collide-los-dist-info string object))
|
||||
@@ -21250,7 +21219,7 @@
|
||||
;; - Types
|
||||
|
||||
(deftype collide-puls-work (structure)
|
||||
((ignore-pat uint32 :offset-assert 0)
|
||||
((ignore-pat pat-surface :offset-assert 0)
|
||||
(tri-out collide-tri-result :offset-assert 4)
|
||||
(bsphere sphere :inline :offset-assert 16)
|
||||
(move-dist vector :inline :offset-assert 32)
|
||||
|
||||
@@ -1740,7 +1740,7 @@ u64 execute(void* ctxt) {
|
||||
printf("too many prims\n");
|
||||
call_addr = c->gprs[t9].du32[0]; // function call:
|
||||
c->sll(v0, ra, 0); // sll v0, ra, 0
|
||||
c->jalr(call_addr); // jalr ra, t9
|
||||
// c->jalr(call_addr); // jalr ra, t9
|
||||
//beq r0, r0, L147 // beq r0, r0, L147
|
||||
// nop // sll r0, r0, 0
|
||||
goto block_15; // branch always
|
||||
|
||||
@@ -5,6 +5,10 @@
|
||||
;; name in dgo: bones-h
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
;; The "bone" system computes bone matrices from joint animations.
|
||||
;; It looks like it also expanded to do most of the DMA generation
|
||||
;; for the foreground renderers.
|
||||
|
||||
(deftype bone-buffer (structure)
|
||||
((joint joint-anim-compressed-hdr 16 :inline :offset-assert 0)
|
||||
(bone bone 16 :inline :offset-assert 1024)
|
||||
|
||||
@@ -685,13 +685,13 @@
|
||||
(t6-0 (-> t5-2 flags))
|
||||
)
|
||||
(-> arg0 cur-lod)
|
||||
(when (zero? (logand t6-0 2))
|
||||
(when (zero? (logand t6-0 (shadow-flags disable-fade)))
|
||||
(if (< (-> t5-2 fade-dist) t4-0)
|
||||
(set! t6-0 (logior t6-0 32))
|
||||
(set! t6-0 (logior t6-0 (shadow-flags disable-draw)))
|
||||
)
|
||||
)
|
||||
(cond
|
||||
((zero? (logand t6-0 32))
|
||||
((zero? (logand t6-0 (shadow-flags disable-draw)))
|
||||
(let ((t2-1 (* t2-0 8))
|
||||
(t4-4 (-> t1-0 total-size))
|
||||
)
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
:flag-assert #xb000000c0
|
||||
(:methods
|
||||
(new (symbol type int) _type_ 0)
|
||||
(dummy-9 (_type_) float 9)
|
||||
(current-cycle-distance (_type_) float 9)
|
||||
(debug-print-channels (_type_ symbol) int 10)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -188,7 +188,7 @@
|
||||
(-> obj channel s4-0 frame-group)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
)
|
||||
(format
|
||||
arg0
|
||||
@@ -617,7 +617,7 @@
|
||||
|
||||
(defun joint-control-copy! ((arg0 joint-control) (arg1 joint-control))
|
||||
"Copy one joint control to another."
|
||||
|
||||
|
||||
;; set fields
|
||||
(set! (-> arg0 blend-index) (-> arg1 blend-index))
|
||||
(set! (-> arg0 active-channels) (-> arg1 active-channels))
|
||||
@@ -636,7 +636,7 @@
|
||||
(the-as pointer (-> arg1 channel))
|
||||
(* 48 (-> arg0 allocated-length))
|
||||
)
|
||||
|
||||
|
||||
;; set parents of channels to point to the dest.
|
||||
(dotimes (v1-7 (-> arg0 allocated-length))
|
||||
(set! (-> arg0 channel v1-7 parent) arg0)
|
||||
@@ -724,9 +724,9 @@
|
||||
(v1-0 0) ;; offset in spad
|
||||
(a1-0 (-> (scratchpad-object terrain-context) work foreground joint-work flattened)) ;; start of data.
|
||||
)
|
||||
|
||||
|
||||
;; loop over active channels.
|
||||
;;
|
||||
;;
|
||||
(dotimes (a0-1 nb-channels)
|
||||
(let ((a2-3 (-> arg0 channel a0-1)))
|
||||
(case (-> a2-3 command)
|
||||
@@ -1029,7 +1029,7 @@
|
||||
(the-as matrix (-> arg0 data))
|
||||
)
|
||||
|
||||
(defmethod dummy-9 cspace ((obj cspace) (arg0 basic))
|
||||
(defmethod reset-and-assign-geo! cspace ((obj cspace) (arg0 basic))
|
||||
(set! (-> obj parent) #f)
|
||||
(set! (-> obj joint) #f)
|
||||
(set! (-> obj geo) arg0)
|
||||
@@ -1044,7 +1044,7 @@
|
||||
(v1-1 type-to-make)
|
||||
)
|
||||
(-> type-to-make size)
|
||||
((method-of-type cspace dummy-9) (the-as cspace (t9-0 allocation v1-1)) arg0)
|
||||
((method-of-type cspace reset-and-assign-geo!) (the-as cspace (t9-0 allocation v1-1)) arg0)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1192,7 +1192,7 @@
|
||||
; (vf12 :class vf) ;; temp
|
||||
; (vf13 :class vf) ;; temp
|
||||
; (vf14 :class vf) ;; temp
|
||||
|
||||
|
||||
; (vf16 :class vf) ;; temp
|
||||
; (t1 :class vf)
|
||||
; (t2 :class vf)
|
||||
@@ -1231,20 +1231,20 @@
|
||||
; (.add.w.vf vf2 vf2 vf0 :mask #b0001)
|
||||
; (.add.w.vf vf3 vf3 vf0 :mask #b0010)
|
||||
; (.add.w.vf vf4 vf4 vf0 :mask #b0100)
|
||||
|
||||
|
||||
; ;; things for cond blocks
|
||||
; (.lvf vf7 (-> t0 transform vector 0))
|
||||
; (.lvf vf8 (-> t0 transform vector 1))
|
||||
; (.lvf vf9 (-> t0 transform vector 2))
|
||||
; (.lvf vf10 (-> t0 transform vector 3))
|
||||
; (.lvf vf1 (-> a2 scale))
|
||||
|
||||
|
||||
; (cond
|
||||
; ((zero? (-> t0 scale w))
|
||||
; (.mul.x.vf vf2 vf2 vf1)
|
||||
; (.mul.y.vf vf3 vf3 vf1)
|
||||
; (.mul.z.vf vf4 vf4 vf1)
|
||||
|
||||
|
||||
; ;; the same
|
||||
; (.matrix*! acc (vf11 vf12 vf13 vf14) (vf2 vf3 vf4 (vf15 vf15 vf15 vf0)) (vf7 vf8 vf9 vf10))
|
||||
; (.svf (-> a2 transform vector 0) vf11)
|
||||
@@ -1256,7 +1256,7 @@
|
||||
; (.mul.x.vf vf2 vf2 vf1)
|
||||
; (.mul.y.vf vf3 vf3 vf1)
|
||||
; (.mul.z.vf vf4 vf4 vf1)
|
||||
|
||||
|
||||
; (.mov t1 (/ 1.0 (-> t0 scale x)))
|
||||
; (.mov t2 (/ 1.0 (-> t0 scale y)))
|
||||
; (.mov t3 (/ 1.0 (-> t0 scale z)))
|
||||
@@ -1266,7 +1266,7 @@
|
||||
; (.mul.vf vf2 vf2 vf16)
|
||||
; (.mul.vf vf3 vf3 vf16)
|
||||
; (.mul.vf vf4 vf4 vf16)
|
||||
|
||||
|
||||
; ;; the same
|
||||
; (.matrix*! acc (vf11 vf12 vf13 vf14) (vf2 vf3 vf4 (vf15 vf15 vf15 vf0)) (vf7 vf8 vf9 vf10))
|
||||
; (.svf (-> a2 transform vector 0) vf11)
|
||||
@@ -1305,7 +1305,7 @@
|
||||
;; ERROR: function was not converted to expressions. Cannot decompile.
|
||||
|
||||
|
||||
|
||||
|
||||
(defun make-joint-jump-tables ()
|
||||
#|
|
||||
#x3ee6b6f9, // = 9 ^ 1055307504
|
||||
@@ -1373,8 +1373,8 @@
|
||||
(set! (-> (scratchpad-object terrain-context) work foreground joint-work fix-jmp-table 15)
|
||||
(the-as (function none) (+ 0 #x3ee6b6f6))
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
(let ((arr (new 'static 'array uint32 16
|
||||
#x7b2191b ;; = 6 ^ 129112349
|
||||
#x7b21914 ;; = 9 ^ 129112349
|
||||
@@ -1399,7 +1399,7 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(let ((arr (new 'static 'array uint32 16
|
||||
#x4d7666df ;; = 6 ^ 1299605209
|
||||
#x4d7666d0 ;; = 9 ^ 1299605209
|
||||
@@ -1442,11 +1442,11 @@
|
||||
; (s6 :reg r13)
|
||||
; )
|
||||
; ;(.sub sp -16)
|
||||
|
||||
|
||||
; (let ((joint-num arg1))
|
||||
|
||||
|
||||
; )
|
||||
|
||||
|
||||
; ;(.add sp 16)
|
||||
; )
|
||||
; )
|
||||
|
||||
@@ -6,13 +6,13 @@
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
;; this file contains types for the skeletal animation system.
|
||||
;; the "bones" are the actual things with positions/orientations/scales in the game world.
|
||||
;; the "joints" define how the bones are connected.
|
||||
;; the "bones" are the actual matrix data consumed by the renderers.
|
||||
;; the "joints" describe how bones are connected.
|
||||
;; a "cspace" links together a bone, joint, and a way to control the joint (and bone)
|
||||
|
||||
;; There's three main container types:
|
||||
;; - The cspace-array. This contains references to the bones and the joints. (called node-list)
|
||||
;; - The skeleton: This contains the bones. (called skeleton)
|
||||
;; - The skeleton: This is an inline array of bones. (called skeleton)
|
||||
;; - The joint-control (not in this file): this has the logic for running joint animations. (called skel)
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
((name basic :offset-assert 4) ;; the joint's name (neckA, neckB, Rtoes, etc)
|
||||
(number int32 :offset-assert 8) ;; the joint's number in the cspace-array
|
||||
(parent joint :offset-assert 12) ;; the parent joint (ex, Lshould has parent of chest)
|
||||
(bind-pose matrix :inline :offset-assert 16) ;; the bind pose, as a matrix. Unknown if used.
|
||||
(bind-pose matrix :inline :offset-assert 16) ;; the bind pose, as a matrix.
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x50
|
||||
@@ -65,7 +65,7 @@
|
||||
|
||||
;; The "cspace" seems to be a system for linking bones and joints.
|
||||
;; The tree structure matches the tree of joints.
|
||||
;; For example: (-> *target* node-list data 14 parent joint) is the same as
|
||||
;; For example: (-> *target* node-list data 14 parent joint) is the same as
|
||||
;; (-> *target* node-list data 14 joint parent)
|
||||
;; But, we appear to use bone indices here.
|
||||
;; So the joint index is always 1 less than the node index.
|
||||
@@ -91,7 +91,7 @@
|
||||
;; params are loaded with signed loads.
|
||||
(:methods
|
||||
(new (symbol type basic) _type_ 0)
|
||||
(dummy-9 (_type_ basic) _type_ 9)
|
||||
(reset-and-assign-geo! (_type_ basic) _type_ 9)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -1458,7 +1458,7 @@
|
||||
(collide-kind background)
|
||||
(the-as process #f)
|
||||
s3-1
|
||||
2
|
||||
(new 'static 'pat-surface :nocamera #x1)
|
||||
)
|
||||
)
|
||||
(s2-1 (new 'stack-no-clear 'vector))
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
(set! (-> self head-offset) (-> *CAMERA_MASTER-bank* onscreen-head-height))
|
||||
(set! (-> self target-height) (-> *CAMERA_MASTER-bank* target-height))
|
||||
(set! (-> self on-ground)
|
||||
(not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags surf11))
|
||||
(not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump))
|
||||
(zero? (logand (-> *target* control status) (cshape-moving-flags onsurf)))
|
||||
)
|
||||
)
|
||||
@@ -386,7 +386,7 @@
|
||||
(collide-kind background)
|
||||
(the-as process #f)
|
||||
s4-2
|
||||
4098
|
||||
(new 'static 'pat-surface :camera #x1 :nocamera #x1 :nolineofsight #x1)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -397,7 +397,7 @@
|
||||
)
|
||||
)
|
||||
(set! (-> self on-ground)
|
||||
(not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags surf11))
|
||||
(not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump))
|
||||
(zero? (logand (-> *target* control status) (cshape-moving-flags onsurf)))
|
||||
)
|
||||
)
|
||||
@@ -405,7 +405,7 @@
|
||||
(let ((gp-6 (new-stack-vector0)))
|
||||
0.0
|
||||
(cond
|
||||
((and (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags surf11))
|
||||
((and (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump))
|
||||
(zero? (logand (-> *target* control status) (cshape-moving-flags onsurf)))
|
||||
)
|
||||
(!= (-> *target* control unknown-surface00 name) 'launch-jump)
|
||||
|
||||
@@ -1243,7 +1243,7 @@
|
||||
(collide-kind background cak-3 wall-object ground-object cak-14)
|
||||
(the-as process #f)
|
||||
s3-0
|
||||
2
|
||||
(new 'static 'pat-surface :nocamera #x1)
|
||||
)
|
||||
0.0
|
||||
)
|
||||
@@ -1554,7 +1554,7 @@
|
||||
)
|
||||
)
|
||||
|
||||
(defun cam-los-spline-collide ((arg0 vector) (arg1 vector) (arg2 vector))
|
||||
(defun cam-los-spline-collide ((arg0 vector) (arg1 vector) (arg2 pat-surface))
|
||||
(let ((s5-0 (new 'stack-no-clear 'vector))
|
||||
(s4-0 *collide-cache*)
|
||||
(f30-0 2.0)
|
||||
@@ -1568,7 +1568,7 @@
|
||||
(-> *CAM_STRING-bank* los-coll-rad2)
|
||||
(collide-kind background cak-3 wall-object ground-object cak-14)
|
||||
(the-as process-drawable #f)
|
||||
(the-as int arg2)
|
||||
arg2
|
||||
)
|
||||
(let* ((f0-2 (vector-length s5-0))
|
||||
(f28-0
|
||||
@@ -1770,7 +1770,7 @@
|
||||
;; WARN: Unsupported inline assembly instruction kind - [mula.s f2, f5]
|
||||
;; WARN: Unsupported inline assembly instruction kind - [madda.s f3, f6]
|
||||
;; WARN: Unsupported inline assembly instruction kind - [madd.s f2, f4, f7]
|
||||
(defbehavior cam-los-collide camera-slave ((arg0 vector) (arg1 vector) (arg2 clip-travel-vector-to-mesh-return-info) (arg3 int))
|
||||
(defbehavior cam-los-collide camera-slave ((arg0 vector) (arg1 vector) (arg2 clip-travel-vector-to-mesh-return-info) (arg3 pat-surface))
|
||||
(local-vars (s1-3 int) (s2-2 int) (f2-1 float) (sv-224 vector) (sv-240 vector))
|
||||
(dist-info-init (the-as collide-los-dist-info (-> arg2 intersection)))
|
||||
(dist-info-init (the-as collide-los-dist-info (-> arg2 next-normal)))
|
||||
@@ -1924,7 +1924,7 @@
|
||||
(cam-los-spline-collide
|
||||
(the-as vector (+ (the-as uint (-> *camera* target-spline)) (* 48 (-> *camera* target-spline end-point))))
|
||||
arg0
|
||||
(the-as vector 4098)
|
||||
(new 'static 'pat-surface :camera #x1 :nocamera #x1 :nolineofsight #x1)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -1957,7 +1957,7 @@
|
||||
(cam-los-spline-collide
|
||||
(the-as vector (+ (the-as uint (-> *camera* target-spline)) (* 48 s2-2)))
|
||||
arg0
|
||||
(the-as vector 4098)
|
||||
(new 'static 'pat-surface :camera #x1 :nocamera #x1 :nolineofsight #x1)
|
||||
)
|
||||
)
|
||||
(< f30-1 0.0)
|
||||
@@ -2224,7 +2224,7 @@
|
||||
(let ((f30-0 (vector-length (-> self view-flat))))
|
||||
(vector--float*! s5-0 (-> *camera* tpos-curr) (-> *camera* local-down) (-> *camera* target-height))
|
||||
(vector-! s5-0 s5-0 (-> self string-trans))
|
||||
(cam-los-collide (-> self string-trans) s5-0 gp-0 4098)
|
||||
(cam-los-collide (-> self string-trans) s5-0 gp-0 (new 'static 'pat-surface :camera #x1 :nocamera #x1 :nolineofsight #x1))
|
||||
(when (-> gp-0 vert-next y)
|
||||
(when (or (= (-> self los-state) (slave-los-state ccw)) (= (-> self los-state) (slave-los-state cw)))
|
||||
(let ((a0-6 (new 'stack-no-clear 'vector)))
|
||||
@@ -2458,7 +2458,7 @@
|
||||
(collide-kind background cak-3 wall-object ground-object cak-14)
|
||||
(the-as process #f)
|
||||
s4-0
|
||||
2
|
||||
(new 'static 'pat-surface :nocamera #x1)
|
||||
)
|
||||
0.0
|
||||
)
|
||||
@@ -2561,7 +2561,7 @@
|
||||
(collide-kind background cak-3 wall-object ground-object cak-14)
|
||||
(the-as process #f)
|
||||
s4-2
|
||||
2
|
||||
(new 'static 'pat-surface :nocamera #x1)
|
||||
)
|
||||
-100000000.0
|
||||
)
|
||||
@@ -2859,7 +2859,7 @@
|
||||
(collide-kind background cak-3 wall-object ground-object cak-14)
|
||||
(the-as process #f)
|
||||
s4-0
|
||||
4098
|
||||
(new 'static 'pat-surface :camera #x1 :nocamera #x1 :nolineofsight #x1)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -2992,7 +2992,7 @@
|
||||
(collide-kind background cak-3 wall-object ground-object cak-14)
|
||||
(the-as process #f)
|
||||
s3-0
|
||||
2
|
||||
(new 'static 'pat-surface :nocamera #x1)
|
||||
)
|
||||
-100000000.0
|
||||
)
|
||||
@@ -3257,7 +3257,7 @@
|
||||
(collide-kind background cak-3 wall-object ground-object cak-14)
|
||||
(the-as process #f)
|
||||
s4-3
|
||||
2
|
||||
(new 'static 'pat-surface :nocamera #x1)
|
||||
)
|
||||
-100000000.0
|
||||
)
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
(num-spheres uint32 :offset-assert 4)
|
||||
(collide-with collide-kind :offset-assert 8)
|
||||
(proc process-drawable :offset-assert 16)
|
||||
(ignore-pat uint32 :offset-assert 20)
|
||||
(ignore-pat pat-surface :offset-assert 20)
|
||||
(solid-only basic :offset-assert 24)
|
||||
)
|
||||
:method-count-assert 9
|
||||
@@ -131,15 +131,15 @@
|
||||
:flag-assert #x2100008670
|
||||
(:methods
|
||||
(debug-draw (_type_) none 9)
|
||||
(fill-and-probe-using-line-sphere (_type_ vector vector float collide-kind process collide-tri-result int) float 10)
|
||||
(fill-and-probe-using-line-sphere (_type_ vector vector float collide-kind process collide-tri-result pat-surface) float 10)
|
||||
(fill-and-probe-using-spheres (_type_ collide-using-spheres-params) symbol 11)
|
||||
(fill-and-probe-using-y-probe (_type_ vector float collide-kind process-drawable collide-tri-result pat-surface) float 12)
|
||||
(fill-using-bounding-box (_type_ bounding-box collide-kind process-drawable pat-surface) none 13)
|
||||
(fill-using-line-sphere (_type_ vector vector float collide-kind process-drawable int) none 14)
|
||||
(fill-using-line-sphere (_type_ vector vector float collide-kind process-drawable pat-surface) none 14)
|
||||
(fill-using-spheres (_type_ collide-using-spheres-params) none 15)
|
||||
(fill-using-y-probe (_type_ vector float collide-kind process-drawable pat-surface) none 16)
|
||||
(initialize (_type_) none 17)
|
||||
(probe-using-line-sphere (_type_ vector vector float collide-kind collide-tri-result int) float 18)
|
||||
(probe-using-line-sphere (_type_ vector vector float collide-kind collide-tri-result pat-surface) float 18)
|
||||
(probe-using-spheres (_type_ collide-using-spheres-params) symbol 19)
|
||||
(probe-using-y-probe (_type_ vector float collide-kind collide-tri-result pat-surface) float 20)
|
||||
(fill-from-background (_type_ (function bsp-header int collide-list none) (function collide-cache object none)) none 21) ;; second functiom is method 28
|
||||
|
||||
@@ -102,16 +102,16 @@
|
||||
(import-mesh-func (function collide-cache object none))
|
||||
)
|
||||
"This terrible function fills the collide cache with background tris from a bounding box."
|
||||
|
||||
|
||||
(local-vars (a0-4 int) (a0-6 int))
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Step 1: Build Collide List
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
|
||||
;; this is a list of fragments that we will look at.
|
||||
|
||||
|
||||
|
||||
|
||||
(set! (-> *collide-list* num-items) 0)
|
||||
(cond
|
||||
((= bsp-find-mesh-func (method-of-type bsp-header collide-ray))
|
||||
@@ -137,14 +137,14 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
(when (> (-> *collide-list* num-items) 0)
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Step 2: Upload to VU0 Data
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
|
||||
;; in classic ND style, this is double buffered.
|
||||
;; we'll undo this.
|
||||
(dotimes (i (-> *collide-list* num-items))
|
||||
@@ -157,14 +157,14 @@
|
||||
(import-mesh-func obj (-> frag mesh))
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Fake it as a prim
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
|
||||
;; The old system can actually read out lists of prims.
|
||||
;; Note that this assumes the cache has been emptied and we're the first to fill it here.
|
||||
|
||||
|
||||
(let ((a0-28 (-> obj num-tris)))
|
||||
(when (> a0-28 0)
|
||||
(let ((v1-55 (-> obj prims))
|
||||
@@ -180,7 +180,7 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
)
|
||||
0
|
||||
(none)
|
||||
@@ -602,7 +602,7 @@
|
||||
(arg2 float)
|
||||
(arg3 collide-kind)
|
||||
(arg4 process-drawable)
|
||||
(arg5 int)
|
||||
(arg5 pat-surface)
|
||||
)
|
||||
(local-vars
|
||||
(zero uint128)
|
||||
@@ -652,7 +652,7 @@
|
||||
(.mul.vf vf8 vf3 vf3)
|
||||
(let ((v1-1 *collide-work*))
|
||||
(.add.vf vf2 vf1 vf3)
|
||||
(set! (-> obj ignore-mask) (the-as pat-surface arg5))
|
||||
(set! (-> obj ignore-mask) arg5)
|
||||
(.mov t0-1 vf21)
|
||||
(nop!)
|
||||
(pabsw-hack t0-2 t0-1) ;; t0-2 is the line, absolute value
|
||||
@@ -663,7 +663,7 @@
|
||||
)
|
||||
(let ((s2-0 (new 'stack-no-clear 'bounding-box)))
|
||||
(set-from-point-offset-pad! s2-0 (the-as vector3s arg0) (the-as vector3s arg1) arg2)
|
||||
(fill-using-bounding-box obj s2-0 arg3 arg4 (the-as pat-surface arg5))
|
||||
(fill-using-bounding-box obj s2-0 arg3 arg4 arg5)
|
||||
)
|
||||
(b! #t cfg-13 :delay (nop!))
|
||||
(set! v1-1 (the-as collide-work 0))
|
||||
@@ -899,7 +899,7 @@
|
||||
to the given collide-list.
|
||||
Note: collide-probe is the faster implementation of this."
|
||||
*collide-work*
|
||||
|
||||
|
||||
;; just iterate over all and check their bsphere.
|
||||
(dotimes (s3-0 arg0)
|
||||
(when (collide-cache-using-line-sphere-test (-> obj bsphere))
|
||||
@@ -921,7 +921,7 @@
|
||||
If the bsphere of the mesh is in the non-aligned bounding box, the mesh will be added
|
||||
to the given collide-list.
|
||||
Note: collide-probe is the faster implementation of this."
|
||||
|
||||
|
||||
;; loop over instance-ties
|
||||
(dotimes (s3-0 arg0)
|
||||
;; first check the instance-tie's bsphere
|
||||
@@ -2307,14 +2307,14 @@
|
||||
(arg3 collide-kind)
|
||||
(arg4 process)
|
||||
(arg5 collide-tri-result)
|
||||
(arg6 int)
|
||||
(arg6 pat-surface)
|
||||
)
|
||||
(fill-using-line-sphere obj arg0 arg1 arg2 arg3 (the-as process-drawable arg4) arg6)
|
||||
(probe-using-line-sphere obj arg0 arg1 arg2 arg3 arg5 arg6)
|
||||
)
|
||||
|
||||
(deftype collide-puls-work (structure)
|
||||
((ignore-pat uint32 :offset-assert 0)
|
||||
((ignore-pat pat-surface :offset-assert 0)
|
||||
(tri-out collide-tri-result :offset-assert 4)
|
||||
(bsphere sphere :inline :offset-assert 16)
|
||||
(move-dist vector :inline :offset-assert 32)
|
||||
@@ -2323,15 +2323,15 @@
|
||||
:size-assert #x30
|
||||
:flag-assert #x900000030
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
(defmethod probe-using-line-sphere collide-cache ((obj collide-cache)
|
||||
(arg0 vector)
|
||||
(arg1 vector)
|
||||
(arg2 float)
|
||||
(arg3 collide-kind)
|
||||
(arg4 collide-tri-result)
|
||||
(arg5 int)
|
||||
(arg5 pat-surface)
|
||||
)
|
||||
(rlet ((vf0 :class vf)
|
||||
(vf2 :class vf)
|
||||
@@ -2343,7 +2343,7 @@
|
||||
(.mov vf4 arg2)
|
||||
(.lvf vf3 (&-> arg0 quad))
|
||||
(.lvf vf2 (&-> arg1 quad))
|
||||
(set! (-> s4-0 ignore-pat) (the-as uint arg5))
|
||||
(set! (-> s4-0 ignore-pat) arg5)
|
||||
(.mul.x.vf vf3 vf0 vf4 :mask #b1000)
|
||||
(set! (-> s4-0 tri-out) arg4)
|
||||
(.svf (&-> s4-0 move-dist quad) vf2)
|
||||
@@ -2373,7 +2373,7 @@
|
||||
)
|
||||
)
|
||||
(else
|
||||
(when (zero? (logand (the-as pat-surface arg5)
|
||||
(when (zero? (logand arg5
|
||||
(-> (the-as collide-shape-prim-sphere (-> (the-as collide-cache-prim s3-0) prim)) pat)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
(set! (-> gp-0 num-verts) (the-as uint 0))
|
||||
(set! (-> gp-0 num-edges) (the-as uint 0))
|
||||
(set! (-> gp-0 num-tris) (the-as uint 0))
|
||||
|
||||
|
||||
(let ((v1-0 (-> obj control)))
|
||||
(set! (-> gp-0 ccache) arg0)
|
||||
(.lvf vf1 (&-> gp-0 local-cache-fill-box min quad))
|
||||
@@ -46,7 +46,7 @@
|
||||
(.svf (&-> gp-0 within-reach-box max quad) vf5)
|
||||
(.svf (&-> gp-0 within-reach-box4w min quad) vf6)
|
||||
(.svf (&-> gp-0 within-reach-box4w max quad) vf7)
|
||||
|
||||
|
||||
;; Fill the collide cache!
|
||||
(fill-using-bounding-box
|
||||
arg0
|
||||
@@ -55,14 +55,14 @@
|
||||
obj
|
||||
(new 'static 'pat-surface :skip #x1 :noentity #x1)
|
||||
)
|
||||
|
||||
|
||||
;; Filter out tris that can't be grabbed
|
||||
(find-grabbable-tris! gp-0)
|
||||
(when (nonzero? (-> gp-0 num-tris))
|
||||
;; Find edges that we might be able to grab
|
||||
(find-grabbable-edges! gp-0)
|
||||
(when (nonzero? (-> gp-0 num-edges))
|
||||
;;
|
||||
;;
|
||||
(set! (-> gp-0 search-pt quad) (-> *target* control unknown-vector90 quad))
|
||||
;; for the search, we either use the direction of the stick, or the heading of target.
|
||||
(when (!= (-> *cpad-list* cpads (-> *target* control unknown-cpad-info00 number) stick0-speed) 0.0)
|
||||
@@ -195,7 +195,7 @@
|
||||
(set! (-> a1-13 num-spheres) (the-as uint 12))
|
||||
(set! (-> a1-13 collide-with) (-> obj cshape root-prim collide-with))
|
||||
(set! (-> a1-13 proc) #f)
|
||||
(set! (-> a1-13 ignore-pat) (the-as uint 1))
|
||||
(set! (-> a1-13 ignore-pat) (new 'static 'pat-surface :noentity #x1))
|
||||
(set! (-> a1-13 solid-only) #t)
|
||||
(if (probe-using-spheres (-> obj ccache) a1-13)
|
||||
(return #f)
|
||||
@@ -331,7 +331,7 @@
|
||||
(set! (-> a1-14 num-spheres) (the-as uint 6))
|
||||
(set! (-> a1-14 collide-with) (-> v1-22 cshape root-prim collide-with))
|
||||
(set! (-> a1-14 proc) #f)
|
||||
(set! (-> a1-14 ignore-pat) (the-as uint 1))
|
||||
(set! (-> a1-14 ignore-pat) (new 'static 'pat-surface :noentity #x1))
|
||||
(set! (-> a1-14 solid-only) #t)
|
||||
(b! #t cfg-21 :delay (nop!))
|
||||
(label cfg-20)
|
||||
@@ -339,7 +339,7 @@
|
||||
(set! (-> a1-14 num-spheres) (the-as uint 6))
|
||||
(set! (-> a1-14 collide-with) (-> v1-22 cshape root-prim collide-with))
|
||||
(set! (-> a1-14 proc) #f)
|
||||
(set! (-> a1-14 ignore-pat) (the-as uint 1))
|
||||
(set! (-> a1-14 ignore-pat) (new 'static 'pat-surface :noentity #x1))
|
||||
(set! (-> a1-14 solid-only) #t)
|
||||
(label cfg-21)
|
||||
(b! (not (fill-and-probe-using-spheres *collide-cache* a1-14)) cfg-24)
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
(set! sv-208 (vector+float*! (new 'stack-no-clear 'vector) (-> arg1 best-tri intersect) sv-160 2867.2))
|
||||
(set! sv-212 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 dynam gravity-normal) -20480.0))
|
||||
(vector+float*! sv-212 sv-212 sv-160 4096.0)
|
||||
(when (>= (probe-using-line-sphere *collide-cache* sv-208 sv-212 409.6 (-> arg1 best-from-prim collide-with) sv-164 1)
|
||||
(when (>= (probe-using-line-sphere *collide-cache* sv-208 sv-212 409.6 (-> arg1 best-from-prim collide-with) sv-164 (new 'static 'pat-surface :noentity #x1))
|
||||
0.0
|
||||
)
|
||||
(set! (-> arg0 unknown-float-coverage-0)
|
||||
@@ -97,7 +97,7 @@
|
||||
(set! sv-276 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 dynam gravity-normal) -20480.0))
|
||||
(vector+float*! sv-272 sv-272 sv-160 -819.2)
|
||||
(vector+float*! sv-276 sv-276 sv-160 -4096.0)
|
||||
(when (>= (probe-using-line-sphere *collide-cache* sv-272 sv-276 409.6 (-> arg1 best-from-prim collide-with) sv-164 1)
|
||||
(when (>= (probe-using-line-sphere *collide-cache* sv-272 sv-276 409.6 (-> arg1 best-from-prim collide-with) sv-164 (new 'static 'pat-surface :noentity #x1))
|
||||
0.0
|
||||
)
|
||||
(set! (-> arg0 unknown-float-coverage-2) (vector-vector-distance sv-272 (-> sv-164 intersect)))
|
||||
@@ -203,7 +203,7 @@
|
||||
(if (= (-> arg0 poly-pat mode) (pat-mode wall))
|
||||
(set! sv-104 (logior sv-104 1))
|
||||
)
|
||||
(if (logtest? (-> arg0 unknown-surface00 flags) (surface-flags surf11))
|
||||
(if (logtest? (-> arg0 unknown-surface00 flags) (surface-flags jump))
|
||||
(set! sv-104 (logior sv-104 32))
|
||||
)
|
||||
(let ((v1-23 (new 'stack-no-clear 'vector)))
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
"Find the overlap between two collide shapes. This is the main entry point for the overlap algorithm.
|
||||
The result is returned in arg1. The obj is collided _with_ arg0 (meaning obj uses its collide-with, arg0 uses colide-as).
|
||||
The best-dist is only valid if the result is #t (it should be negative then)"
|
||||
|
||||
|
||||
;; this method begins the recursive traversal through the tree of collide-shape-prims, starting with the
|
||||
;; root of each shape.
|
||||
(local-vars (v1-3 collide-action) (v1-4 float) (a2-2 collide-action) (a3-2 collide-action))
|
||||
@@ -36,7 +36,7 @@
|
||||
(vf5 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
|
||||
|
||||
;; reset the overlap result
|
||||
(let ((v1-0 arg1))
|
||||
(set! (-> v1-0 best-dist) 0.0)
|
||||
@@ -62,11 +62,11 @@
|
||||
)
|
||||
;; reject if non-solid
|
||||
(b! (zero? v1-3) cfg-8 :delay (nop!))
|
||||
|
||||
|
||||
;; if we're here, our collision types allow us to collide
|
||||
(.lvf vf1 (&-> a0-1 prim-core world-sphere quad))
|
||||
(.lvf vf2 (&-> a1-1 prim-core world-sphere quad))
|
||||
|
||||
|
||||
;; see if bsphere's overlap
|
||||
(.sub.vf vf3 vf1 vf2)
|
||||
(.add.w.vf vf4 vf1 vf2 :mask #b1000)
|
||||
@@ -81,12 +81,12 @@
|
||||
(.mov v1-4 vf5)
|
||||
(b! (<= f0-1 v1-4) cfg-8) ;; they don't, fail!
|
||||
)
|
||||
|
||||
|
||||
;; our bsphere's overlap. We need a more detailed test to know for sure
|
||||
;; this will dispatch a more specific method for a0-1.
|
||||
(should-push-away-test a0-1 a1-1 arg1)
|
||||
)
|
||||
|
||||
|
||||
;; return the result of the more detailed test.
|
||||
(let ((v0-1 (< (-> arg1 best-dist) 0.0)))
|
||||
(b! #t cfg-9 :delay (nop!))
|
||||
@@ -234,7 +234,7 @@
|
||||
|
||||
(defmethod should-push-away-test collide-shape-prim-mesh ((obj collide-shape-prim-mesh) (arg0 collide-shape-prim) (arg1 collide-overlap-result))
|
||||
"Collide a prim with a mesh. The prim must be a sphere or group of spheres"
|
||||
|
||||
|
||||
;; first, check the prim type
|
||||
(let ((v1-0 (-> arg0 prim-core prim-type)))
|
||||
(b! (nonzero? v1-0) cfg-2 :delay (nop!))
|
||||
@@ -248,7 +248,7 @@
|
||||
(let ((s3-0 (-> obj mesh)))
|
||||
;; if we don't have a mesh, then abort.
|
||||
(b! (not s3-0) cfg-11 :delay (nop!)) ;; empty-form
|
||||
|
||||
|
||||
;; we must put the mesh in the cache before we can collide.
|
||||
;; NOTE: this is not the full collide-cache, but instead a smaller, simpler collide-mesh-cche.
|
||||
(let ((s2-0 *collide-mesh-cache*))
|
||||
@@ -265,7 +265,7 @@
|
||||
;; and remember the cache has this
|
||||
(set! (-> obj mesh-cache-id) (-> s2-0 id))
|
||||
)
|
||||
|
||||
|
||||
;; load this mesh into the cache.
|
||||
;; strangely, they transform the entire mesh.
|
||||
(populate-cache!
|
||||
@@ -367,7 +367,7 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
;; make up a triangle.
|
||||
(let ((s4-1 (-> arg1 best-from-tri normal))
|
||||
(s3-0 (-> arg1 best-from-tri intersect))
|
||||
@@ -391,7 +391,7 @@
|
||||
)
|
||||
)
|
||||
(b! #t cfg-13 :delay (nop!))
|
||||
|
||||
|
||||
;; Mesh. this is the same as the above function. start with populating the cache.
|
||||
(label cfg-5)
|
||||
(let ((s3-1 (-> (the-as collide-shape-prim-mesh arg0) mesh)))
|
||||
@@ -691,7 +691,7 @@
|
||||
"Find somewhere safe to land. This is used to find where to bounce back the player if you jump on fire canyon.
|
||||
It's a nice example function for the collision system."
|
||||
(local-vars (direction-idx int) (sv-192 int))
|
||||
|
||||
|
||||
;; first, let's find our heading
|
||||
(let ((current-heading (if (< 819.2 (vector-xz-length (-> target-ctrl transv))) ;; if we're moving in the xz plane
|
||||
(vector-y-angle (-> target-ctrl transv)) ;; use the direction we're moving
|
||||
@@ -703,7 +703,7 @@
|
||||
(probe-dir (new 'stack-no-clear 'vector))
|
||||
(result-tri (new 'stack-no-clear 'collide-tri-result))
|
||||
)
|
||||
|
||||
|
||||
;; create a bounding box, centered around our current location.
|
||||
(let ((bbox (new 'stack-no-clear 'bounding-box)))
|
||||
(set! (-> ground-result w) 0.0)
|
||||
@@ -715,7 +715,7 @@
|
||||
;; except for in y (height). Look 10m down, and 5m up.
|
||||
(set! (-> bbox min y) (+ -40960.0 (-> current-pos y)))
|
||||
(set! (-> bbox max y) (+ 20480.0 (-> current-pos y)))
|
||||
|
||||
|
||||
;; fill the collide cache will all the triangles in bounding box.
|
||||
(fill-using-bounding-box
|
||||
*collide-cache*
|
||||
@@ -725,7 +725,7 @@
|
||||
(new 'static 'pat-surface :noentity #x1)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
;; loop over 8 directions to check.
|
||||
(set! direction-idx 0)
|
||||
(while (< direction-idx 8)
|
||||
@@ -738,19 +738,19 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
;; this will count the number of hits we have in this direction.
|
||||
(set! sv-192 0)
|
||||
|
||||
|
||||
;; we don't know anything, so assume we can go the maximum length in this direction
|
||||
(let ((max-len-this-dir max-len))
|
||||
;; but, if we did max-len bounce in this direction, we might hit some wall mid-bounce.
|
||||
|
||||
|
||||
;; start with a probe of max len, pointing straight forward.
|
||||
(set-vector! probe-dir 0.0 0.0 max-len 1.0)
|
||||
;; rotate to point along our heading
|
||||
(vector-rotate-y! probe-dir probe-dir probe-heading)
|
||||
|
||||
|
||||
;; see how far we can go, 10m above the current target.
|
||||
;; this is likely checking to see if we'll hit a wall mid-bounce
|
||||
(if (>= (probe-using-line-sphere
|
||||
@@ -760,20 +760,20 @@
|
||||
2048.0
|
||||
(-> target-ctrl root-prim collide-with)
|
||||
result-tri
|
||||
1
|
||||
(new 'static 'pat-surface :noentity #x1)
|
||||
)
|
||||
0.0
|
||||
)
|
||||
(set! max-len-this-dir (+ -6144.0 (vector-vector-xz-distance current-pos (-> result-tri intersect))))
|
||||
)
|
||||
|
||||
|
||||
;; now, let's search between start-len and max-len-this-dir to see if there's somewhere safe to bounce.
|
||||
(let ((current-len start-len))
|
||||
(while (>= max-len-this-dir current-len)
|
||||
;; probe heading
|
||||
(set-vector! probe-dir 0.0 0.0 current-len 1.0)
|
||||
(vector-rotate-y! probe-dir probe-dir probe-heading)
|
||||
|
||||
|
||||
;; put probe dir at the end of the probe
|
||||
(vector+! probe-dir current-pos probe-dir)
|
||||
;; start 10m above the curren pos.
|
||||
@@ -786,7 +786,7 @@
|
||||
10240.0
|
||||
(-> target-ctrl root-prim collide-with)
|
||||
result-tri
|
||||
1
|
||||
(new 'static 'pat-surface :noentity #x1)
|
||||
)
|
||||
0.0
|
||||
)
|
||||
@@ -910,7 +910,7 @@
|
||||
(set! (-> obj surf) *standard-ground-surface*)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
;; ca-9 gets set whenever you get on the zoomer. If we are on the zoomer, just go to "race-track"
|
||||
(if (logtest? (-> obj root-prim prim-core action) (collide-action ca-9))
|
||||
(set! (-> obj surf) *race-track-surface*)
|
||||
@@ -959,14 +959,14 @@
|
||||
(set! sv-72 (new 'stack-no-clear 'vector))
|
||||
(set! sv-80 0)
|
||||
(set! (-> sv-72 quad) (-> arg3 quad))
|
||||
|
||||
|
||||
;; move along the vector by the best move-vec
|
||||
;; this will hit the best-tri
|
||||
(let ((a1-1 (new 'stack-no-clear 'vector)))
|
||||
(vector-float*! a1-1 (-> arg1 move-vec) (-> arg1 best-u))
|
||||
(move-by-vector! arg0 a1-1)
|
||||
)
|
||||
|
||||
|
||||
;; so handle hitting that tri
|
||||
(set-and-handle-pat! arg0 (-> arg1 best-tri pat))
|
||||
(vector-! sv-64 (the-as vector (-> arg1 best-from-prim prim-core)) (-> arg1 best-tri intersect))
|
||||
@@ -980,8 +980,8 @@
|
||||
(if (= (-> arg1 best-u) 0.0)
|
||||
(move-by-vector! arg0 sv-68)
|
||||
)
|
||||
|
||||
;;
|
||||
|
||||
;;
|
||||
(set! (-> arg0 surface-normal quad) (-> sv-68 quad))
|
||||
(set! (-> arg0 poly-normal quad) (-> arg1 best-tri normal quad))
|
||||
(set! (-> arg0 surface-angle) (vector-dot sv-68 (-> arg0 dynam gravity-normal)))
|
||||
@@ -1074,19 +1074,19 @@
|
||||
(defmethod step-collison! collide-shape-moving ((obj collide-shape-moving) (arg0 vector) (arg1 vector) (arg2 float))
|
||||
"Take 1 step in the collision. Attempt to move at velocity of arg1, for arg2 of a step.
|
||||
The resulting velocity is stored in arg0. The amount of a step actually taken is returned."
|
||||
|
||||
|
||||
(local-vars (sv-192 int))
|
||||
(let ((s5-0 (new 'stack 'collide-shape-intersect))
|
||||
(s2-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
|
||||
|
||||
;; integrate our velocity, get the "move vector"
|
||||
;; which is what we'd move if we hit nothing.
|
||||
(vector-float*! s2-0 arg1 (* arg2 (-> *display* seconds-per-frame)))
|
||||
|
||||
|
||||
;; initialize the collision data.
|
||||
(init! s5-0 s2-0)
|
||||
|
||||
|
||||
;; only if we have something in the collide cache, I guess.
|
||||
(let* ((s1-1 (-> obj root-prim))
|
||||
(v1-4 *collide-cache*)
|
||||
@@ -1106,21 +1106,21 @@
|
||||
(set! s0-0 (-> (the-as (inline-array collide-cache-prim) s0-0) 1))
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
;; now we've collided with everything. If we have a best-u of > 0, it means we can't do the full move.
|
||||
(let ((f30-0 (-> s5-0 best-u)))
|
||||
(cond
|
||||
((>= f30-0 0.0)
|
||||
(let ((s2-1 (new 'stack-no-clear 'vector)))
|
||||
|
||||
|
||||
;; if debugging, remember our input velocity.
|
||||
(if *display-collision-marks*
|
||||
(set! (-> s2-1 quad) (-> arg1 quad))
|
||||
)
|
||||
|
||||
|
||||
;; do the collision reaction! this function should move the collide shape.
|
||||
(set! (-> obj prev-status) (the-as cshape-moving-flags ((-> obj reaction) obj s5-0 arg0 arg1)))
|
||||
|
||||
|
||||
;; debug draw collision marks.
|
||||
(when *display-collision-marks*
|
||||
(let ((t1-0 (-> *pat-mode-info* (-> s5-0 best-tri pat mode) hilite-color)))
|
||||
@@ -1161,7 +1161,7 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
;; and return the step size we could take.
|
||||
(return f30-0)
|
||||
)
|
||||
@@ -1214,16 +1214,16 @@
|
||||
It will process updates from hitting triangles with pat-surfaces
|
||||
It will update the touching list.
|
||||
It will update the current surface and surface flags."
|
||||
|
||||
|
||||
;; update the world-spheres for us and our children.
|
||||
(update-transforms! obj)
|
||||
|
||||
|
||||
;; remember our history
|
||||
(set! (-> obj trans-old 2 quad) (-> obj trans-old 1 quad))
|
||||
(set! (-> obj trans-old 1 quad) (-> obj trans-old 0 quad))
|
||||
(set! (-> obj trans-old 0 quad) (-> obj trans quad))
|
||||
(set! (-> obj prev-status) (-> obj status))
|
||||
|
||||
|
||||
;; setup
|
||||
(logclear! (-> obj status) (cshape-moving-flags
|
||||
onsurf
|
||||
@@ -1246,7 +1246,7 @@
|
||||
(set! (-> obj poly-normal quad) (-> obj dynam gravity-normal quad))
|
||||
(set! (-> obj coverage) 0.0)
|
||||
(set! (-> obj touch-angle) 0.0)
|
||||
|
||||
|
||||
;; we want to take a step of 1.0
|
||||
(let ((f30-0 1.0)
|
||||
(s4-0 0) ;; iterations
|
||||
@@ -1256,7 +1256,7 @@
|
||||
(not (and (= (-> arg0 x) 0.0) (= (-> arg0 y) 0.0) (= (-> arg0 z) 0.0))) ;; nonzero velocity
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
;; note that in between step-collision! and update-from-step-szie, the touching list is in an invalid state.
|
||||
(let ((f28-0 (step-collison! obj arg0 arg0 f30-0))) ;; step forward!
|
||||
(update-from-step-size *touching-list* f28-0) ;; update touching list.
|
||||
@@ -1273,13 +1273,13 @@
|
||||
"Specialization of integrate and collide for the target"
|
||||
;; time it
|
||||
(stopwatch-start (-> *collide-stats* total-target))
|
||||
|
||||
|
||||
;; check and correct massive velocity.
|
||||
(when (< 1638400.0 (vector-length arg0))
|
||||
(format 0 "WARNING: target vel is ~M m/s, reseting to zero.~%" (vector-length arg0))
|
||||
(vector-reset! arg0)
|
||||
)
|
||||
|
||||
|
||||
;; ???
|
||||
(set! (-> obj unknown-vector15 quad) (-> obj unknown-vector14 quad))
|
||||
(vector-matrix*! (-> obj unknown-vector14) (-> obj unknown-vector13) (-> obj unknown-matrix02))
|
||||
@@ -1291,7 +1291,7 @@
|
||||
(s4-1 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(set! (-> s4-1 quad) (-> arg0 quad))
|
||||
|
||||
|
||||
;; call the normal integrate.
|
||||
(let ((t9-7 (method-of-type collide-shape-moving integrate-and-collide!)))
|
||||
(t9-7 obj s3-1)
|
||||
@@ -1541,7 +1541,7 @@
|
||||
arg1
|
||||
(-> obj process)
|
||||
sv-144
|
||||
1
|
||||
(new 'static 'pat-surface :noentity #x1)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -1570,7 +1570,7 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
;; if we need to collide with things.
|
||||
(when (logtest? (-> obj root-prim collide-with) (collide-kind cak-1 cak-2 cak-3 target))
|
||||
(let ((a1-7 (new 'stack-no-clear 'overlaps-others-params)))
|
||||
@@ -1675,7 +1675,7 @@
|
||||
(vf2 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
|
||||
|
||||
;; scale the velocity, to see how far we can go, at max.
|
||||
(let ((a0-1 (new 'stack-no-clear 'vector)))
|
||||
(let ((v1-0 a0-1))
|
||||
@@ -1688,9 +1688,9 @@
|
||||
(.mul.x.vf vf1 vf1 vf2 :mask #b111)
|
||||
(.svf (&-> v1-0 quad) vf1)
|
||||
)
|
||||
|
||||
|
||||
;; add a bonus size if we are target.
|
||||
(let ((f0-2 (+ (vector-length a0-1)
|
||||
(let ((f0-2 (+ (vector-length a0-1)
|
||||
(if (= (-> obj process type) target)
|
||||
4096.0
|
||||
0.0
|
||||
@@ -2487,7 +2487,7 @@
|
||||
(vf5 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
|
||||
|
||||
;; kill the mesh cache
|
||||
(let* ((v1-0 *collide-mesh-cache*)
|
||||
(a0-1 (-> v1-0 id))
|
||||
@@ -2499,10 +2499,10 @@
|
||||
(set! (-> v1-0 id) (the-as uint a0-2))
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
;; loop over everything!
|
||||
(let ((s5-0 (-> obj root-prim collide-with)))
|
||||
|
||||
|
||||
;; we collide with target, so check the player list.
|
||||
(when (logtest? s5-0 (collide-kind target))
|
||||
(let ((v1-5 (-> *collide-player-list* alive-list next0)))
|
||||
@@ -2524,7 +2524,7 @@
|
||||
(let ((s1-0 (new 'stack-no-clear 'vector)))
|
||||
(let ((v1-19 (new 'stack-no-clear 'vector)))
|
||||
(set! (-> v1-19 quad) (-> s3-0 trans quad))
|
||||
|
||||
|
||||
;; this is... a bit of a hack.
|
||||
;; this adjusts our collision to be within 0.7 - 1.4m of our base.
|
||||
;; (note, this only applies for intermediate iterations of this loop)
|
||||
@@ -2588,10 +2588,10 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
(when (logtest? s5-0 (collide-kind cak-1 cak-2 cak-3))
|
||||
|
||||
|
||||
(when (logtest? s5-0 (collide-kind cak-1))
|
||||
(let ((v1-38 (-> *collide-hit-by-player-list* alive-list next0)))
|
||||
*collide-hit-by-player-list*
|
||||
@@ -2667,8 +2667,8 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
(when (logtest? s5-0 (collide-kind cak-2))
|
||||
(let ((v1-70 (-> *collide-usually-hit-by-player-list* alive-list next0)))
|
||||
*collide-usually-hit-by-player-list*
|
||||
|
||||
@@ -185,13 +185,13 @@
|
||||
(artist-step float :offset 28)
|
||||
(master-art-group-name string :offset 32)
|
||||
(master-art-group-index int32 :offset 36)
|
||||
|
||||
|
||||
;; facial animation
|
||||
(blerc-data (pointer uint8) :offset 40) ;; todo, this is probably something else
|
||||
|
||||
|
||||
;; compressed animation data
|
||||
(frames joint-anim-compressed-control :offset 44)
|
||||
|
||||
|
||||
;; per-joint info for each joint in the animation.
|
||||
(data joint-anim-compressed :dynamic)
|
||||
)
|
||||
@@ -384,6 +384,7 @@
|
||||
(-> obj skeleton bones 0 position)
|
||||
)
|
||||
|
||||
;; look up the index of an art element in an art group.
|
||||
(desfun art-elt->index (ag-name elt-name)
|
||||
(if (number? elt-name)
|
||||
elt-name
|
||||
@@ -424,7 +425,7 @@
|
||||
;; set joint geometry and joint bones
|
||||
(set! (-> skel jgeo) ,(art-elt->index (string->symbol-format "{}-ag" art-name) joint-geom))
|
||||
(set! (-> skel janim) ,(art-elt->index (string->symbol-format "{}-ag" art-name) joint-anim))
|
||||
|
||||
|
||||
;; set lods
|
||||
,@(apply-i (lambda (x i)
|
||||
`(begin
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
(deftype memory-usage-block (basic)
|
||||
((work-bsp basic :offset-assert 4)
|
||||
(length int32 :offset-assert 8)
|
||||
(data memory-usage-info 109 :inline :offset-assert 16) ;; guess
|
||||
(data memory-usage-info 109 :inline :offset-assert 16)
|
||||
)
|
||||
:method-count-assert 12
|
||||
:size-assert #x6e0
|
||||
@@ -58,14 +58,13 @@
|
||||
;; bit 3 : count tie colors 2 (geom 2)
|
||||
;; bit 4 : ?? (geom 3)
|
||||
|
||||
|
||||
;; Memory usage stats are organized by the type of object.
|
||||
;; This enum allows you to go from type to the index in the memory-usage-block's data array.
|
||||
(defenum mem-usage-id
|
||||
:bitfield #f
|
||||
:type uint32
|
||||
(drawable-group 0)
|
||||
(tfragment-unknown 1) ;; made up name
|
||||
(tfragment 1)
|
||||
(tfragment-base 2)
|
||||
(tfragment-common 3)
|
||||
(tfragment-level0 4)
|
||||
@@ -75,11 +74,11 @@
|
||||
(tfragment-pal 8)
|
||||
(tie-fragment 9)
|
||||
(tie-gif 10)
|
||||
(tie-point 11)
|
||||
(tie-points 11)
|
||||
(tie-colors 12)
|
||||
(tie-draw-points 13)
|
||||
(tie-debug 14)
|
||||
;; 15??
|
||||
(tie-near 15)
|
||||
(tie-pal 16)
|
||||
(tie-generic 17)
|
||||
(instance-tie 18)
|
||||
@@ -87,7 +86,7 @@
|
||||
(instance-tie-colors1 20)
|
||||
(instance-tie-colors2 21)
|
||||
(instance-tie-colors3 22)
|
||||
(instance-tie-colors 23)
|
||||
(instance-tie-colors* 23)
|
||||
(prototype-bucket-shrub 24)
|
||||
(generic-shrub 25)
|
||||
(generic-shrub-data 26)
|
||||
@@ -98,7 +97,9 @@
|
||||
(shrubbery-stq 31)
|
||||
(shrubbery-pal 32)
|
||||
(billboard 33)
|
||||
;; ???
|
||||
(instance-shrubbery 34)
|
||||
(pris-fragment 35)
|
||||
;; ??
|
||||
(entity 43)
|
||||
(camera 44)
|
||||
(nav-mesh 45)
|
||||
@@ -138,10 +139,10 @@
|
||||
(string 80)
|
||||
(array 81)
|
||||
(sprite 82)
|
||||
;;
|
||||
(depth-cue 83)
|
||||
(debug-dma 84) ;; maybe
|
||||
(sky-dma 85) ;; maybe
|
||||
;;
|
||||
(pris-generic)
|
||||
(4k-dead-pool 87)
|
||||
(8k-dead-pool 88)
|
||||
(16k-dead-pool 89)
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
;; - all leaves are stored at the same depth
|
||||
;; - all nodes and leaves have visibility IDs
|
||||
|
||||
;; shrub does not have these properties
|
||||
;; shrub does not have these properties - it supports arbitrary children counts, leaves
|
||||
;; may occur at any depth, and nothing has visibility ids.
|
||||
|
||||
(deftype draw-node (drawable)
|
||||
((child-count uint8 :offset 6) ;; if our child requires a count
|
||||
@@ -24,7 +25,7 @@
|
||||
:method-count-assert 18
|
||||
:size-assert #x20
|
||||
:flag-assert #x1200000020
|
||||
;; field distance is a float printed as hex?
|
||||
;; field distance is a float printed as hex?
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -60,9 +60,9 @@
|
||||
(trans vector :offset-assert 120)
|
||||
(sound-id sound-id :offset-assert 124)
|
||||
(mode symbol :offset-assert 128)
|
||||
(total-time time-frame :offset-assert 136)
|
||||
(total-off-time time-frame :offset-assert 144)
|
||||
(last-time time-frame :offset-assert 152)
|
||||
(total-time time-frame :offset-assert 136)
|
||||
(total-off-time time-frame :offset-assert 144)
|
||||
(last-time time-frame :offset-assert 152)
|
||||
(voicebox handle :offset-assert 160)
|
||||
)
|
||||
:heap-base #x40
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
;; and that certain methods should only be called at certain times, and may require coordination
|
||||
;; with having certain VU0 or scratchpad data present.
|
||||
;; In many cases, "draw" simply adds data to a buffer that must later be converted to dma in finish-background
|
||||
;; or similar.
|
||||
;; or similar. Or just does nothing.
|
||||
|
||||
(declare-type drawable-error drawable)
|
||||
(deftype drawable (basic)
|
||||
@@ -45,10 +45,10 @@
|
||||
|
||||
;; different for different types, but usually does nothing.
|
||||
(debug-draw (_type_ drawable display-frame) none 15)
|
||||
|
||||
|
||||
;; given VIS data (uncompressed), compute the visiblity bit string.
|
||||
(unpack-vis (_type_ (pointer int8) (pointer int8)) (pointer int8) 16)
|
||||
|
||||
|
||||
;; find "ambients" inside the given sphere and add to list.
|
||||
(collect-ambients (_type_ sphere int ambient-list) none 17)
|
||||
)
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
;; it's used over drawable-group when there are a lot of drawables to iterate over because it is faster.
|
||||
|
||||
;; a drawable-inline-array itself has no idea what it stores so you almost always need a more specific type.
|
||||
;; without a more specific type, the stride of the elements is unknown.
|
||||
|
||||
(deftype drawable-inline-array (drawable)
|
||||
((length int16 :offset 6)
|
||||
|
||||
@@ -170,7 +170,7 @@
|
||||
(set! gp-0 (the-as cspace-array #f))
|
||||
(goto cfg-16)
|
||||
)
|
||||
(let ((v1-10 ((method-of-type cspace dummy-9) (the-as cspace (-> gp-0 data)) #f)))
|
||||
(let ((v1-10 ((method-of-type cspace reset-and-assign-geo!) (the-as cspace (-> gp-0 data)) #f)))
|
||||
(set! (-> v1-10 bone) (the-as bone (-> s4-1 bones)))
|
||||
(let ((a0-6 (-> gp-0 data)))
|
||||
(set! (-> a0-6 0 param0) cspace<-transformq!)
|
||||
@@ -179,13 +179,13 @@
|
||||
(set! (-> v1-10 bone cache bone-matrix) (the-as uint 0))
|
||||
)
|
||||
0
|
||||
(let ((v1-14 (dummy-9 (-> gp-0 data 1) #f)))
|
||||
(let ((v1-14 (reset-and-assign-geo! (-> gp-0 data 1) #f)))
|
||||
(set! (-> v1-14 joint) (-> arg0 data 0))
|
||||
(set! (-> v1-14 bone) (-> s4-1 bones 1))
|
||||
(set! (-> v1-14 parent) (the-as cspace (-> gp-0 data)))
|
||||
(set! (-> v1-14 bone cache bone-matrix) (the-as uint 128))
|
||||
)
|
||||
(let ((v1-17 (dummy-9 (-> gp-0 data 2) #f)))
|
||||
(let ((v1-17 (reset-and-assign-geo! (-> gp-0 data 2) #f)))
|
||||
(set! (-> v1-17 joint) (-> arg0 data 1))
|
||||
(set! (-> v1-17 bone) (-> s4-1 bones 2))
|
||||
(set! (-> v1-17 parent) (the-as cspace (-> gp-0 data)))
|
||||
@@ -203,7 +203,7 @@
|
||||
0
|
||||
)
|
||||
)
|
||||
(v1-29 (dummy-9 (-> gp-0 data s3-0) #f))
|
||||
(v1-29 (reset-and-assign-geo! (-> gp-0 data s3-0) #f))
|
||||
)
|
||||
(set! (-> v1-29 joint) s1-0)
|
||||
(set! (-> v1-29 bone) (-> s4-1 bones s3-0))
|
||||
@@ -383,7 +383,7 @@
|
||||
)
|
||||
; (draw-bone-lines obj)
|
||||
;; (draw-joint-spheres obj)
|
||||
|
||||
|
||||
0
|
||||
(none)
|
||||
)
|
||||
@@ -889,7 +889,7 @@
|
||||
)
|
||||
"set various joint anim parameters for self and eval them.
|
||||
you can use this for playing animations!
|
||||
|
||||
|
||||
chan = the channel to modify. defaults to 0 (base channel). this is usually what you want.
|
||||
group! = when not #f, set this as the new frame-group. defaults to #f
|
||||
num! = set the frame playback function. this is what determines what frame an animation is at. funcs below.
|
||||
@@ -900,7 +900,7 @@
|
||||
frame-num = set the frame-num field.
|
||||
frame-interp = set the frame-interp field.
|
||||
dist = set the dist field.
|
||||
|
||||
|
||||
available num! functions:
|
||||
- (+!) = advance anim.
|
||||
- (-!) = reverse anim.
|
||||
@@ -915,7 +915,7 @@
|
||||
- min = the start of the animation.
|
||||
- max = the end of the animation.
|
||||
"
|
||||
|
||||
|
||||
(let* ((num-args (if (pair? num!) (cdr num!) '()))
|
||||
(num! (if (pair? num!) (car num!) num!))
|
||||
(nf (cond
|
||||
@@ -1136,7 +1136,7 @@
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod dummy-9 joint-control ((obj joint-control))
|
||||
(defmethod current-cycle-distance joint-control ((obj joint-control))
|
||||
(cond
|
||||
((< (the-as int (-> obj root-channel)) (the-as int (-> obj channel (-> obj active-channels))))
|
||||
(let ((s5-0 (-> obj root-channel (-> obj root-channel 0 group-size)))
|
||||
@@ -1209,7 +1209,7 @@
|
||||
|
||||
(defbehavior process-drawable-delay-player process-drawable ((arg0 time-frame))
|
||||
(while (and *target*
|
||||
(logtest? (-> *target* control unknown-surface00 flags) (surface-flags surf11))
|
||||
(logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump))
|
||||
(zero? (logand (-> *target* control status) (cshape-moving-flags onsurf)))
|
||||
)
|
||||
(suspend)
|
||||
|
||||
@@ -38,12 +38,19 @@
|
||||
:flag-assert #x900000004
|
||||
)
|
||||
|
||||
;; the possible state for a level.
|
||||
;;;;;;;;;;;;;;;
|
||||
;; Load State
|
||||
;;;;;;;;;;;;;;;
|
||||
|
||||
;; The load state system lets gameplay code control the loading state of the game.
|
||||
;; It is the interface to the code inside of level.gc that actually manages loads.
|
||||
|
||||
;; the possible load state for a level.
|
||||
(deftype level-buffer-state (structure)
|
||||
((name symbol :offset-assert 0) ;; level name
|
||||
(display? symbol :offset-assert 4) ;; should it be drawn?
|
||||
(force-vis? symbol :offset-assert 8) ;; ? should it have its vis loaded?
|
||||
(force-inside? symbol :offset-assert 12) ;; ?
|
||||
((name symbol :offset-assert 0) ;; level name
|
||||
(display? symbol :offset-assert 4) ;; should it be drawn?
|
||||
(force-vis? symbol :offset-assert 8) ;; force everything to be visible.
|
||||
(force-inside? symbol :offset-assert 12) ;; force player to be considered inside.
|
||||
)
|
||||
:pack-me
|
||||
:method-count-assert 9
|
||||
@@ -51,11 +58,13 @@
|
||||
:flag-assert #x900000010
|
||||
)
|
||||
|
||||
;; This includes more state than just "loading" - it also has a list of commands to execute and
|
||||
;; other random state.
|
||||
(deftype load-state (basic)
|
||||
((want level-buffer-state 2 :inline :offset-assert 4)
|
||||
(vis-nick symbol :offset-assert 36)
|
||||
(command-list pair :offset-assert 40)
|
||||
(object-name symbol 256 :offset-assert 44)
|
||||
((want level-buffer-state 2 :inline :offset-assert 4) ;; the two levels we want loaded
|
||||
(vis-nick symbol :offset-assert 36) ;; the vis file we have loaded
|
||||
(command-list pair :offset-assert 40) ;; list of additional commands
|
||||
(object-name symbol 256 :offset-assert 44) ;; state of various in-game objects
|
||||
(object-status basic 256 :offset-assert 1068)
|
||||
)
|
||||
:method-count-assert 21
|
||||
@@ -87,6 +96,10 @@
|
||||
(define-extern *load-state* load-state)
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Game Info
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defenum continue-flags
|
||||
:type uint32
|
||||
:bitfield #t
|
||||
@@ -151,22 +164,22 @@
|
||||
(text-ids-seen bit-array :offset-assert 112)
|
||||
(level-opened uint8 32 :offset-assert 116)
|
||||
(hint-control (array level-hint-control) :offset-assert 148)
|
||||
(task-hint-control (array task-hint-control-group) :offset-assert 152)
|
||||
(task-hint-control (array task-hint-control-group) :offset-assert 152)
|
||||
(total-deaths int32 :offset-assert 156)
|
||||
(continue-deaths int32 :offset-assert 160)
|
||||
(fuel-cell-deaths int32 :offset-assert 164)
|
||||
(game-start-time time-frame :offset-assert 168)
|
||||
(continue-time time-frame :offset-assert 176)
|
||||
(death-time time-frame :offset-assert 184)
|
||||
(hit-time time-frame :offset-assert 192)
|
||||
(fuel-cell-pickup-time time-frame :offset-assert 200)
|
||||
(fuel-cell-time (array time-frame) :offset-assert 208)
|
||||
(enter-level-time (array time-frame) :offset-assert 212)
|
||||
(in-level-time (array time-frame) :offset-assert 216)
|
||||
(blackout-time time-frame :offset-assert 224)
|
||||
(letterbox-time time-frame :offset-assert 232) ;; time to turn off letterboxing, base-frame
|
||||
(hint-play-time time-frame :offset-assert 240)
|
||||
(display-text-time time-frame :offset-assert 248)
|
||||
(game-start-time time-frame :offset-assert 168)
|
||||
(continue-time time-frame :offset-assert 176)
|
||||
(death-time time-frame :offset-assert 184)
|
||||
(hit-time time-frame :offset-assert 192)
|
||||
(fuel-cell-pickup-time time-frame :offset-assert 200)
|
||||
(fuel-cell-time (array time-frame) :offset-assert 208)
|
||||
(enter-level-time (array time-frame) :offset-assert 212)
|
||||
(in-level-time (array time-frame) :offset-assert 216)
|
||||
(blackout-time time-frame :offset-assert 224)
|
||||
(letterbox-time time-frame :offset-assert 232) ;; time to turn off letterboxing, base-frame
|
||||
(hint-play-time time-frame :offset-assert 240)
|
||||
(display-text-time time-frame :offset-assert 248)
|
||||
(display-text-handle handle :offset-assert 256)
|
||||
(death-movie-tick int32 :offset-assert 264)
|
||||
(want-auto-save symbol :offset-assert 268)
|
||||
|
||||
@@ -726,7 +726,7 @@
|
||||
(change-sound! (-> self sound) (static-sound-name "blue-eco-jak"))
|
||||
(let ((v1-150 (rand-vu-int-range 3 (+ (-> self node-list length) -1))))
|
||||
(cond
|
||||
((and (logtest? (-> self control unknown-surface00 flags) (surface-flags surf11))
|
||||
((and (logtest? (-> self control unknown-surface00 flags) (surface-flags jump))
|
||||
(zero? (logand (-> self control status) (cshape-moving-flags onsurf)))
|
||||
)
|
||||
(set! (-> *part-id-table* 259 init-specs 4 initial-valuef) 0.0)
|
||||
|
||||
@@ -5,6 +5,10 @@
|
||||
;; name in dgo: hint-control-h
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
;; The "hint" system is used to give the player hints if they appear to be stuck
|
||||
;; Hints can belong to either a level or a task. The hint-control types have
|
||||
;; parameters about how often the hints should come, and what they are tied to.
|
||||
|
||||
(defenum hint-command
|
||||
(if-unknown 0)
|
||||
(if-known 1)
|
||||
@@ -22,21 +26,23 @@
|
||||
(if-at-most-need-reminder-a 13)
|
||||
)
|
||||
|
||||
;; information about an in-level hint. These aren't tied to a specific object or task.
|
||||
(deftype level-hint-control (structure)
|
||||
((delay-before-playing time-frame :offset-assert 0)
|
||||
((delay-before-playing time-frame :offset-assert 0)
|
||||
(id game-text-id :offset-assert 8)
|
||||
(num-attempts-before-playing int8 :offset-assert 12)
|
||||
(num-success-before-killing int8 :offset-assert 13)
|
||||
(num-attempts int8 :offset-assert 14)
|
||||
(num-success int8 :offset-assert 15)
|
||||
(start-time time-frame :offset-assert 16)
|
||||
(last-time-called time-frame :offset-assert 24)
|
||||
(num-attempts-before-playing int8 :offset-assert 12)
|
||||
(num-success-before-killing int8 :offset-assert 13)
|
||||
(num-attempts int8 :offset-assert 14)
|
||||
(num-success int8 :offset-assert 15)
|
||||
(start-time time-frame :offset-assert 16)
|
||||
(last-time-called time-frame :offset-assert 24)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x20
|
||||
:flag-assert #x900000020
|
||||
)
|
||||
|
||||
;; a "task hint" is explicitly tied to an in-game task.
|
||||
(deftype task-hint-control (structure)
|
||||
((task game-task :offset-assert 0)
|
||||
(delay time-frame :offset-assert 8)
|
||||
|
||||
@@ -664,7 +664,7 @@
|
||||
(defbehavior process-taskable-hide-enter process-taskable ()
|
||||
(set! (-> self state-time) (-> *display* base-frame-counter))
|
||||
(let ((v1-3 (-> self draw shadow-ctrl)))
|
||||
(logior! (-> v1-3 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-3 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(process-taskable-clean-up-after-talking)
|
||||
@@ -684,7 +684,7 @@
|
||||
(restore-collide-with-as (-> self root-override))
|
||||
(process-entity-status! self (entity-perm-status bit-3) #t)
|
||||
(let ((v1-7 (-> self draw shadow-ctrl)))
|
||||
(logclear! (-> v1-7 settings flags) (shadow-flags shdf05))
|
||||
(logclear! (-> v1-7 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
)
|
||||
@@ -916,7 +916,7 @@
|
||||
)
|
||||
((begin
|
||||
(dummy-46 self)
|
||||
(and (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags surf11))
|
||||
(and (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump))
|
||||
(zero? (logand (-> *target* control status) (cshape-moving-flags onsurf)))
|
||||
)
|
||||
)
|
||||
@@ -1300,7 +1300,7 @@
|
||||
)
|
||||
(else
|
||||
(let ((v1-10 gp-0))
|
||||
(logior! (-> v1-10 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-10 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
)
|
||||
|
||||
@@ -10,6 +10,21 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;; The generic renderer is the slow but general renderer.
|
||||
;; On the EE side, it supports effects like lighting, environment mapping,
|
||||
;; level of detail, and skeletal animation.
|
||||
|
||||
;; On the VU side, it has no effects, other than scissoring.
|
||||
|
||||
;; It is slow for many reasons:
|
||||
;; - no EE side scissoring detection - each triangle is checked on the VU.
|
||||
;; - EE side effects waste lots of time packing to the upload format
|
||||
;; - no instancing support
|
||||
;; - no vertex duplication support
|
||||
|
||||
;; There are three paths to using generic:
|
||||
;; - merc will use generic for scissoring or envmap (called mercneric)
|
||||
;; - shrub will use generic for scissoring
|
||||
;; - tie will use generic for envmap
|
||||
|
||||
|
||||
;; gsf, what does it stand for?
|
||||
|
||||
@@ -5,19 +5,20 @@
|
||||
;; name in dgo: generic-vu1-h
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
|
||||
;; "pris" refers to foreground drawing, with normals.
|
||||
(deftype pris-mtx (structure)
|
||||
((data float 32 :offset 0)
|
||||
(vector vector 8 :inline :offset 0)
|
||||
(t-mtx matrix :inline :offset 0)
|
||||
(n-mtx matrix3 :inline :offset 64)
|
||||
(scale vector :inline :offset 112)
|
||||
(t-mtx matrix :inline :offset 0) ;; transformation matrix (including perspective)
|
||||
(n-mtx matrix3 :inline :offset 64) ;; rotation matrix for the normals
|
||||
(scale vector :inline :offset 112) ;; not sure this is used... merc doesn't do it this way.
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x80
|
||||
:flag-assert #x900000080
|
||||
)
|
||||
|
||||
;; ??
|
||||
(deftype generic-pris-mtx-save (structure)
|
||||
((loc-mtx pris-mtx :inline :offset-assert 0)
|
||||
(par-mtx pris-mtx :inline :offset-assert 128)
|
||||
@@ -28,6 +29,7 @@
|
||||
:flag-assert #x900000180
|
||||
)
|
||||
|
||||
;; VU1 constants for the generic renderer.
|
||||
(deftype generic-constants (structure)
|
||||
((fog vector :inline :offset-assert 0)
|
||||
(adgif gs-gif-tag :inline :offset-assert 16) ;; was qword
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
;; name in dgo: generic-work-h
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
;; common types for internal generic work.
|
||||
|
||||
(deftype generic-input-buffer (structure)
|
||||
((merc generic-merc-work :inline :offset 0)
|
||||
(tie generic-tie-work :inline :offset 0)
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
|
||||
;; this type represents the lights that can be sent to the VU for merc (and maybe generic?) rendering.
|
||||
;; it contains 3 directional lights and an ambient light.
|
||||
;; Note that the data is transposed to be faster for use in the VU code.
|
||||
;; the w components are unused for lighting information - you can put whatever you want in them...
|
||||
(deftype vu-lights (structure)
|
||||
((direction vector 3 :inline :offset-assert 0)
|
||||
(color vector 3 :inline :offset-assert 48)
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
;; name in dgo: generic-merc-h
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
;; The "generic merc" renderer converts merc data to be used by generic.
|
||||
;; It is used for environment mapping and scissoring in the original game.
|
||||
|
||||
(deftype merc-matrix (structure)
|
||||
((quad uint128 8 :offset-assert 0)
|
||||
(vector vector 8 :inline :offset 0)
|
||||
|
||||
@@ -5,6 +5,12 @@
|
||||
;; name in dgo: merc-h
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
;; The "merc" renderer is the main foreground renderer.
|
||||
;; All foreground objects are stored in merc format.
|
||||
;; See bones.gc for where it's actually used and the pc port changes.
|
||||
|
||||
;; The "ripple" system can apply a ripple effect (for waves or similar) to merc data.
|
||||
;; This defines which vertices should be rippled.
|
||||
(deftype ripple-merc-query (inline-array-class)
|
||||
((start-vertex int32 :offset-assert 16)
|
||||
(vertex-skip int32 :offset-assert 20)
|
||||
@@ -16,37 +22,38 @@
|
||||
:size-assert #x20
|
||||
:flag-assert #x900000020
|
||||
)
|
||||
|
||||
(set! (-> ripple-merc-query heap-base) 16)
|
||||
|
||||
;; header to fragments uploaded to VU.
|
||||
;; This gets upacked with v4_8 mode.
|
||||
;; for a more detailed description of the various formats, see extract_merc.cpp
|
||||
;; Note that a fragment may rely on vertices, GS state, and matrices from a previous
|
||||
;; fragment in the same merc "effect".
|
||||
(deftype merc-byte-header (structure)
|
||||
((srcdest-off uint8 :offset-assert 0)
|
||||
(rgba-off uint8 :offset-assert 1)
|
||||
(lump-off uint8 :offset-assert 2)
|
||||
(fp-off uint8 :offset-assert 3)
|
||||
(mat1-cnt uint8 :offset-assert 4)
|
||||
(mat2-cnt uint8 :offset-assert 5)
|
||||
(mat3-cnt uint8 :offset-assert 6)
|
||||
(samecopy-cnt uint8 :offset-assert 7)
|
||||
(crosscopy-cnt uint8 :offset-assert 8)
|
||||
(strip-len uint8 :offset-assert 9)
|
||||
(mm-quadword-fp-off uint8 :offset-assert 10)
|
||||
(mm-quadword-size uint8 :offset-assert 11)
|
||||
(perc-off uint8 :offset-assert 12)
|
||||
(mat-slot uint8 10 :offset-assert 13)
|
||||
;; these offsets are after unpacking/upload to VU.
|
||||
((srcdest-off uint8 :offset-assert 0) ;; location of srcdst table for vertex copying
|
||||
(rgba-off uint8 :offset-assert 1) ;; location of rgba data
|
||||
(lump-off uint8 :offset-assert 2) ;; location of "lump" packed vertex data
|
||||
(fp-off uint8 :offset-assert 3) ;; location of "fp" data (adgif shader, some floats)
|
||||
|
||||
(mat1-cnt uint8 :offset-assert 4) ;; number of vertices influenced by one bone
|
||||
(mat2-cnt uint8 :offset-assert 5) ;; two bone
|
||||
(mat3-cnt uint8 :offset-assert 6) ;; three bone
|
||||
|
||||
(samecopy-cnt uint8 :offset-assert 7) ;; number of vertices to copy from this fragment
|
||||
(crosscopy-cnt uint8 :offset-assert 8) ;; copy vertices from previous fragment count
|
||||
(strip-len uint8 :offset-assert 9) ;; how long is the initial strip before a shader (may be 0, if starts with shader)
|
||||
(mm-quadword-fp-off uint8 :offset-assert 10) ;; main memory offset of fp data
|
||||
(mm-quadword-size uint8 :offset-assert 11) ;; main memory size of whole fragment
|
||||
(perc-off uint8 :offset-assert 12) ;; bone weight table offset
|
||||
(mat-slot uint8 10 :offset-assert 13) ;; which matrices to upload where for this fragment
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x17
|
||||
:flag-assert #x900000017
|
||||
)
|
||||
|
||||
;; merc VU fragment.
|
||||
;; The mm-quadword-size includes the header.
|
||||
;; The data itself is split into two parts:
|
||||
;; - ??
|
||||
;; - fp data, containing a merc-fp-data then "fp" data.
|
||||
;; the merc-fragment-fp-data function will get a pointer to fp data.
|
||||
;; merc VU fragment: contains the header and data.
|
||||
(deftype merc-fragment (structure)
|
||||
((header merc-byte-header :inline :offset-assert 0)
|
||||
(rest uint8 1 :offset-assert 23)
|
||||
@@ -59,16 +66,19 @@
|
||||
)
|
||||
)
|
||||
|
||||
;; packed merc vertex, before unpack by VIF
|
||||
;; the meaning of flags is situation dependent in the renderer, see extract_merc.cpp
|
||||
;; for the details.
|
||||
(deftype merc-vtx (structure)
|
||||
((mat-0 uint8 :offset-assert 0)
|
||||
(mat-1 uint8 :offset-assert 1)
|
||||
(nrm-x uint8 :offset-assert 2)
|
||||
(pos-x uint8 :offset-assert 3)
|
||||
(dst-0 uint8 :offset-assert 4)
|
||||
(dst-1 uint8 :offset-assert 5)
|
||||
(nrm-y uint8 :offset-assert 6)
|
||||
(pos-y uint8 :offset-assert 7)
|
||||
(tex-s uint8 :offset-assert 8)
|
||||
((mat-0 uint8 :offset-assert 0) ;; matrix number for first bone (and flags)
|
||||
(mat-1 uint8 :offset-assert 1) ;; matrix number for second bone (and flags)
|
||||
(nrm-x uint8 :offset-assert 2) ;; x component of normal
|
||||
(pos-x uint8 :offset-assert 3) ;; x component of position
|
||||
(dst-0 uint8 :offset-assert 4) ;; location to place vertex (and flags)
|
||||
(dst-1 uint8 :offset-assert 5) ;; location to place vertex 2 (and flags)
|
||||
(nrm-y uint8 :offset-assert 6) ;; normal
|
||||
(pos-y uint8 :offset-assert 7) ;; pos
|
||||
(tex-s uint8 :offset-assert 8) ;; texture coordinate
|
||||
(tex-t uint8 :offset-assert 9)
|
||||
(nrm-z uint8 :offset-assert 10)
|
||||
(pos-z uint8 :offset-assert 11)
|
||||
@@ -99,9 +109,10 @@
|
||||
(the merc-fp-header (&+ arg0 (the-as uint (shl (-> arg0 header mm-quadword-fp-off) 4))))
|
||||
)
|
||||
|
||||
;; a description of a matrix upload to merc
|
||||
(deftype merc-mat-dest (structure)
|
||||
((matrix-number uint8 :offset-assert 0)
|
||||
(matrix-dest uint8 :offset-assert 1)
|
||||
((matrix-number uint8 :offset-assert 0) ;; the matrix in the skeleton
|
||||
(matrix-dest uint8 :offset-assert 1) ;; the slot in the shader (only a small number available)
|
||||
)
|
||||
:pack-me
|
||||
:method-count-assert 9
|
||||
@@ -111,6 +122,7 @@
|
||||
|
||||
;; some info about a merc fragment that will stay on the EE.
|
||||
;; the merc-effect contains a ref to one of these
|
||||
;; this is all the information needed to generate merc upload dma (counts/sizes)
|
||||
(deftype merc-fragment-control (structure)
|
||||
((unsigned-four-count uint8 :offset-assert 0)
|
||||
(lump-four-count uint8 :offset-assert 1)
|
||||
@@ -123,11 +135,13 @@
|
||||
:flag-assert #x900000004
|
||||
)
|
||||
|
||||
;; packed blend shape data
|
||||
(deftype merc-blend-data (structure) ;; was unknown!
|
||||
((int8-data int8 :dynamic :offset-assert 0)
|
||||
)
|
||||
)
|
||||
|
||||
;; info needed to set up blend shapes
|
||||
(deftype merc-blend-ctrl (structure)
|
||||
((blend-vtx-count uint8 :offset-assert 0)
|
||||
(nonzero-index-count uint8 :offset-assert 1)
|
||||
@@ -138,10 +152,11 @@
|
||||
:flag-assert #x900000002
|
||||
)
|
||||
|
||||
;; info for environment map "extra"
|
||||
(deftype mei-envmap-tint (structure)
|
||||
((fade0 float :offset-assert 0)
|
||||
(fade1 float :offset-assert 4)
|
||||
(tint uint32 :offset-assert 8)
|
||||
((fade0 float :offset-assert 0) ;; start fade
|
||||
(fade1 float :offset-assert 4) ;; end fade
|
||||
(tint uint32 :offset-assert 8) ;; envmap color
|
||||
(dummy int32 :offset-assert 12)
|
||||
)
|
||||
:method-count-assert 9
|
||||
@@ -149,6 +164,7 @@
|
||||
:flag-assert #x900000010
|
||||
)
|
||||
|
||||
;; info for texture scrolling "extra"
|
||||
(deftype mei-texture-scroll (structure)
|
||||
((max-dist float :offset-assert 0)
|
||||
(st-int-scale uint8 :offset-assert 4)
|
||||
@@ -163,6 +179,7 @@
|
||||
:flag-assert #x900000010
|
||||
)
|
||||
|
||||
;; info for ripple effect "extra"
|
||||
(deftype mei-ripple (structure)
|
||||
((x-base float :offset-assert 0)
|
||||
(z-base float :offset-assert 4)
|
||||
@@ -174,6 +191,7 @@
|
||||
:flag-assert #x900000010
|
||||
)
|
||||
|
||||
;; locations of the "extra"s.
|
||||
(deftype merc-extra-info (structure)
|
||||
((envmap-tint-offset uint8 :offset-assert 0)
|
||||
(shader-offset uint8 :offset-assert 1)
|
||||
@@ -186,6 +204,8 @@
|
||||
:flag-assert #x900000010
|
||||
)
|
||||
|
||||
;; a collection of fragments that must be sent all together.
|
||||
;; and their extra effects.
|
||||
(deftype merc-effect (structure)
|
||||
((frag-geo merc-fragment :offset-assert 0)
|
||||
(frag-ctrl merc-fragment-control :offset-assert 4)
|
||||
@@ -200,7 +220,7 @@
|
||||
(dummy1 uint8 :offset-assert 26)
|
||||
(envmap-usage uint8 :offset-assert 27)
|
||||
(extra-info merc-extra-info :offset-assert 28)
|
||||
|
||||
|
||||
;; added
|
||||
(data uint64 4 :offset 0)
|
||||
)
|
||||
@@ -212,10 +232,15 @@
|
||||
)
|
||||
)
|
||||
|
||||
;; eye info (for a single eye)
|
||||
;; there's a pupil, iris, and lid. The pupil and iris can move around (together),
|
||||
;; The pupil/iris can be scaled (independtenly)
|
||||
;; the eyelid goes up and down
|
||||
(deftype merc-eye-ctrl (structure)
|
||||
((eye-slot int8 :offset-assert 0)
|
||||
(shader-offset int8 :offset-assert 1)
|
||||
((eye-slot int8 :offset-assert 0) ;; slot in anim data
|
||||
(shader-offset int8 :offset-assert 1) ;; offset in merc data
|
||||
(shader-count int8 :offset-assert 2)
|
||||
;; copies of the shader.
|
||||
(iris-shader adgif-shader :inline :offset-assert 16)
|
||||
(pupil-shader adgif-shader :inline :offset-assert 96)
|
||||
(lid-shader adgif-shader :inline :offset-assert 176)
|
||||
@@ -226,6 +251,7 @@
|
||||
:flag-assert #x900000100
|
||||
)
|
||||
|
||||
;; single frame for eye animation
|
||||
(deftype merc-eye-anim-frame (structure)
|
||||
((pupil-trans-x int8 :offset-assert 0)
|
||||
(pupil-trans-y int8 :offset-assert 1)
|
||||
@@ -241,6 +267,7 @@
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
|
||||
;; just an array of eye anim frames.
|
||||
(deftype merc-eye-anim-block (structure)
|
||||
((max-frame int16 :offset-assert 0)
|
||||
(data merc-eye-anim-frame :inline :dynamic :offset 8)
|
||||
@@ -251,7 +278,8 @@
|
||||
)
|
||||
|
||||
|
||||
;; metadata for merc art
|
||||
;; metadata for merc art for a single model
|
||||
;; mostly just stats and parameters used in dma/rendering.
|
||||
(deftype merc-ctrl-header (structure)
|
||||
((xyz-scale float :offset-assert 0)
|
||||
(st-magic uint32 :offset-assert 4)
|
||||
@@ -297,10 +325,10 @@
|
||||
:method-count-assert 9
|
||||
:size-assert #x50
|
||||
:flag-assert #x900000050
|
||||
;; field xyz-scale is a float printed as hex?
|
||||
;; field xyz-scale is a float printed as hex?
|
||||
)
|
||||
|
||||
;; the actual merc art object.
|
||||
;; the actual merc art object: a header and list of effects
|
||||
(deftype merc-ctrl (art-element)
|
||||
((num-joints int32 :offset 20)
|
||||
(header merc-ctrl-header :inline :offset-assert 32)
|
||||
@@ -311,6 +339,7 @@
|
||||
:flag-assert #xd00000070
|
||||
)
|
||||
|
||||
;; low memory upload to vu1 for merc (which merc later writes over)
|
||||
(deftype merc-vu1-low-mem (structure)
|
||||
((tri-strip-gif gs-gif-tag :inline :offset-assert 0) ;; was qword
|
||||
(ad-gif gs-gif-tag :inline :offset-assert 16) ;; was qword
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
;; the "mood" system sets the fog, lights, and sun to smoothly blend between two levels.
|
||||
;; each level has 8 "moods".
|
||||
;; each level has 8 "moods" corresponding to the 8 times of day.
|
||||
;; the mood system blends together moods to create smooth transitions between levels and times of day.
|
||||
|
||||
;; set of fog parameters
|
||||
(deftype mood-fog (structure)
|
||||
@@ -90,6 +91,7 @@
|
||||
;; these "times" are the time-of-day weights. the w is the weight, the rest is just 1.
|
||||
(times vector 8 :inline :offset-assert 1696)
|
||||
(sky-times float 8 :offset-assert 1824)
|
||||
;; times as integers. For use in rendering code.
|
||||
(itimes vector4w 4 :inline :offset-assert 1856)
|
||||
(state uint8 16 :offset-assert 1920)
|
||||
(num-stars float :offset-assert 1936)
|
||||
|
||||
@@ -5,52 +5,33 @@
|
||||
;; name in dgo: shadow-cpu-h
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
;; The shadow renderer is partially on the EE and on VU1.
|
||||
;; This "shadow-cpu" portion is what runs on the EE.
|
||||
|
||||
;; The renderer generates a shadow volume and uses some bits in the alpha plane like a stencil buffer.
|
||||
;; It reuses the bones of the merc renderer, but uses a simplified mesh and at most 2 bones per vertex.
|
||||
|
||||
(defenum shadow-flags
|
||||
:bitfield #t
|
||||
:type int32
|
||||
(shdf00)
|
||||
(shdf01)
|
||||
(disable-fade) ;; ignore max distance settings
|
||||
(shdf02)
|
||||
(shdf03)
|
||||
(shdf04)
|
||||
(shdf05)
|
||||
(shdf06)
|
||||
(shdf07)
|
||||
(shdf08)
|
||||
(shdf09)
|
||||
(shdf10)
|
||||
(shdf11)
|
||||
(shdf12)
|
||||
(shdf13)
|
||||
(shdf14)
|
||||
(shdf15)
|
||||
(shdf16)
|
||||
(shdf17)
|
||||
(shdf18)
|
||||
(shdf19)
|
||||
(shdf20)
|
||||
(shdf21)
|
||||
(shdf22)
|
||||
(shdf23)
|
||||
(shdf24)
|
||||
(shdf25)
|
||||
(shdf26)
|
||||
(shdf27)
|
||||
(shdf28)
|
||||
(shdf29)
|
||||
(shdf30)
|
||||
(shdf31)
|
||||
(disable-draw) ;; disable completely.
|
||||
)
|
||||
|
||||
;; settings computed by the user, consumed by the shadow renderer
|
||||
(deftype shadow-settings (structure)
|
||||
((center vector :inline :offset-assert 0)
|
||||
(flags shadow-flags :offset 12)
|
||||
((center vector :inline :offset-assert 0) ;; unused?
|
||||
(flags shadow-flags :offset 12) ;; used to disable, most other flags do nothing?
|
||||
(shadow-dir vector :inline :offset-assert 16)
|
||||
(dist-to-locus float :offset 28)
|
||||
(bot-plane plane :inline :offset-assert 32)
|
||||
(bot-plane plane :inline :offset-assert 32) ;; volume clip plane
|
||||
(top-plane plane :inline :offset-assert 48)
|
||||
(fade-dist float :offset-assert 64)
|
||||
(fade-start float :offset-assert 68)
|
||||
(fade-dist float :offset-assert 64) ;; if past this, stop drawing shadow
|
||||
(fade-start float :offset-assert 68) ;; distance where fadeout starts
|
||||
(dummy-2 int32 :offset-assert 72)
|
||||
(dummy-3 int32 :offset-assert 76)
|
||||
(fade-vec vector :inline :offset 64) ;; added
|
||||
@@ -72,7 +53,7 @@
|
||||
(set-offset-bit (shadow-control) int 10)
|
||||
(set-top-plane-offset (shadow-control float) int 11)
|
||||
(set-bottom-plane-offset (shadow-control float) int 12)
|
||||
(dummy-13 (_type_) none 13)
|
||||
(unused-13 (_type_) none 13)
|
||||
(update-direction-from-time-of-day (_type_) none 14)
|
||||
(collide-to-find-planes (_type_ vector float float float) none 15)
|
||||
)
|
||||
|
||||
@@ -590,11 +590,11 @@
|
||||
(set! (-> v1-0 y) (+ 4096.0 (-> v1-0 y)))
|
||||
(set-vector! a2-1 0.0 (- arg3) 0.0 1.0)
|
||||
(cond
|
||||
((>= (fill-and-probe-using-line-sphere *collide-cache* v1-0 a2-1 8192.0 (collide-kind background) pp s4-0 1)
|
||||
((>= (fill-and-probe-using-line-sphere *collide-cache* v1-0 a2-1 8192.0 (collide-kind background) pp s4-0 (new 'static 'pat-surface :noentity #x1))
|
||||
0.0
|
||||
)
|
||||
(let ((v1-2 obj))
|
||||
(logclear! (-> v1-2 settings flags) (shadow-flags shdf05))
|
||||
(logclear! (-> v1-2 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(let ((v1-4 obj))
|
||||
@@ -606,7 +606,7 @@
|
||||
)
|
||||
(else
|
||||
(let ((v1-7 obj))
|
||||
(logior! (-> v1-7 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-7 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
)
|
||||
|
||||
@@ -37,8 +37,6 @@
|
||||
;; During a level load, the first texture-page loaded is TFRAG, which contains both "near" and "common" data.
|
||||
;; TFRAG is the only known thing to use "near"
|
||||
|
||||
;; Note: there is something weird going on with the zoomer hud texture.
|
||||
|
||||
;; On the DVD, textures are stored in "tpage files". Each file contains:
|
||||
;; - a texture-page object, describing the file
|
||||
;; - a texture object per texture, describing each texture (possibly multiple textures, mipmapped textures are considered 1 "texture")
|
||||
@@ -65,13 +63,13 @@
|
||||
;; the first 0x24000 words are for level 0, and the last 0x24000 words are for level 1.
|
||||
;; the stuff in the middle is shared and lazily loaded as needed.
|
||||
|
||||
;; there are 5 texture uploads per frame:
|
||||
;; there are 5 texture uploads per frame per level:
|
||||
;; - TFRAG
|
||||
;; - PRIS
|
||||
;; - SHRUB
|
||||
;; - ALPHA
|
||||
;; - WATER
|
||||
;; it is unknown how this works when drawing two levels.
|
||||
;; And also a single "common" texture upload for textures like HUD.
|
||||
|
||||
;; Generally, "dest" refers to a location in vram, specified in 32-bit words.
|
||||
;; block-data is a pointer to EE memory containing texture data.
|
||||
@@ -134,9 +132,7 @@
|
||||
(+ (-> arg0 data (mem-usage-id texture) count) (-> obj length)))
|
||||
|
||||
;; We subtract off the size of the textures. This makes the memory usage negative!
|
||||
;; I don't understand why this happens, but
|
||||
;; - it matches the game (texture size shows up as negative in the debug menu)
|
||||
;; - the game sizes seem correct.
|
||||
;; I don't see why this is correct.
|
||||
(let ((v1-7 (- (asize-of obj) (the-as int (shl (-> obj size) 2)))))
|
||||
;; add 64-bytes for each entry, the size of texture.
|
||||
(dotimes (a0-6 (-> obj length))
|
||||
@@ -562,7 +558,7 @@
|
||||
(allocate-defaults! obj)
|
||||
(set! (-> obj font-palette) (allocate-vram-words! obj 64))
|
||||
|
||||
;; clear out common pages.
|
||||
;; mark the common page area as not-uploaded.
|
||||
(dotimes (v1-6 32)
|
||||
(set! (-> obj common-page v1-6) (the-as texture-page 0))
|
||||
)
|
||||
@@ -979,6 +975,8 @@
|
||||
|
||||
(defun upload-vram-pages-pris ((pool texture-pool) (segment texture-pool-segment) (page texture-page) (bucket-idx bucket-id) (needed-mask int))
|
||||
"Upload the entire texture page. If the needed-mask is not set, it will not upload those chunks.
|
||||
Unlike other pages, it's pretty easy to determine a mask of needed textures - if you draw no cows, don't bother
|
||||
uploading cow textures.
|
||||
Upload will be added to the given bucket for on-screen.
|
||||
The nth bit of the mask determines if the nth 16-kB chunk is needed in this upload.
|
||||
A 64-bit mask is enough to address the entire common segment, which is the only destination for PRIS textures."
|
||||
@@ -1109,13 +1107,11 @@
|
||||
)
|
||||
|
||||
;; upload near data, and update the upload cache stuff.
|
||||
;; Doesn't this upload more than is needed, and also the shared texture memory?
|
||||
;; How does this avoid overwriting the TFRAG textures that might be in use by the
|
||||
;; currently rendering frame?
|
||||
;; I think this relies on "mode 2" uploads only being in the private area.
|
||||
(upload-now! page 2)
|
||||
(update-vram-pages pool (-> pool segment-near) page 2)
|
||||
|
||||
;; our strategy is to remove the private memory from RAM.
|
||||
;; our strategy is to remove the private memory from RAM to save memory, now that it's in VRAM.
|
||||
;; to avoid leaving an unused hole, we copy the shared data backward.
|
||||
;; unfortunately, it would be too slow to do it now.
|
||||
;; this function runs during level loading, during the login of the linked tpage file.
|
||||
@@ -1208,7 +1204,7 @@
|
||||
(cond
|
||||
((< (the-as uint NEAR_PRIVATE_WORDS) seg2-size)
|
||||
;; we use the shared part. Kick out only the non-shared texture.
|
||||
;; it's on th end this time, so no mempcy like in near-allocate-0
|
||||
;; it's on the end this time, so no mempcy like in near-allocate-0
|
||||
(set! (-> page segment 2 size) (+ -147456 (the-as int seg2-size)))
|
||||
(set! (-> heap current)
|
||||
(&+ (-> page segment 2 block-data) (shl (-> page segment 2 size) 2))
|
||||
@@ -1377,7 +1373,8 @@
|
||||
)
|
||||
|
||||
(if (>= max-page-kind 0) ;; tfrag.
|
||||
;; login with near allocator.
|
||||
;; login the texture. If the texture isn't there, it will try to load it
|
||||
;; and allocate with the given allocation function.
|
||||
(let ((tfrag-dir-entry (texture-page-login
|
||||
(-> id-array 0)
|
||||
(if (= (-> level index) 1)
|
||||
@@ -2068,7 +2065,8 @@
|
||||
)
|
||||
|
||||
(defmethod relocate texture-page ((obj texture-page) (arg0 kheap) (arg1 (pointer uint8)))
|
||||
"Add to VRAM and allocate links"
|
||||
"Add to VRAM and allocate links.
|
||||
This method is called by the GOAL linker when it loads a texture page."
|
||||
(tex-dbg "loaded tpage ~A~%" obj
|
||||
;;(-> obj info file-name)
|
||||
;;(-> obj info maya-file-name)
|
||||
@@ -2171,7 +2169,7 @@
|
||||
#f
|
||||
)
|
||||
)
|
||||
;; and load it! The loado links but doesn't execute
|
||||
;; and load it! The loado links but doesn't execute the relocate method.
|
||||
(s2-0 (the-as texture-page (loado file-name heap)))
|
||||
)
|
||||
;; if we loaded, relocate!
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
;; name in dgo: generic-tie-h
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
;; Generic tie converts tie data to generic and supports environment mapping.
|
||||
|
||||
(deftype generic-tie-instance (structure)
|
||||
((matrix-tag dma-packet :inline :offset-assert 0)
|
||||
(matrix-data vector 6 :inline :offset-assert 16)
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
|
||||
;; The "prototype" system is used for instanced background rendering (shrub and tie).
|
||||
|
||||
;; The first type is the bucket. There's one bucket per prototype. Each prototype can have up to
|
||||
;; 4 geometries (level of details). Lower numbers are higher detail.
|
||||
;; The first type is the bucket. There's one bucket per prototype which collects instances.
|
||||
;; Each prototype can have up to 4 geometries (level of details). Lower numbers are higher detail.
|
||||
;; During drawing, the engine will build linked lists of instance data. Each instance will pick
|
||||
;; a geom, based on distance from the camera (or other settings) and will add itself to the list
|
||||
;; for that geom.
|
||||
@@ -22,7 +22,7 @@
|
||||
(rdists vector :inline :offset-assert 48) ;; lod settings
|
||||
(next uint32 4 :offset-assert 64) ;; linked list of instances of each geom.
|
||||
(count uint16 4 :offset-assert 80) ;; number of each instance with each geom.
|
||||
|
||||
|
||||
;; overlays
|
||||
(near-plane meters :offset 32)
|
||||
(near-stiff meters :offset 36)
|
||||
@@ -128,7 +128,7 @@
|
||||
)
|
||||
|
||||
;; all tie prototypes and pointer to level's wind data.
|
||||
;; in practice, they are shared with all tie/shrub trees in the level
|
||||
;; in practice, they are shared with all tie/shrub trees in the level
|
||||
(deftype proxy-prototype-array-tie (basic)
|
||||
((prototype-array-tie prototype-array-tie :offset-assert 4)
|
||||
(wind-vectors uint32 :offset-assert 8)
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
;; name in dgo: wind-h
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
;; These "wind" types are used in the tie/shrub renderers.
|
||||
;; These "wind" types are used in the tie/shrub renderers to make things sway in the breeze.
|
||||
;; It generates vectors that are applied as shear to the instance matrices.
|
||||
|
||||
(deftype wind-vector (structure)
|
||||
((wind-pos vector2w :inline :offset-assert 0)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
)
|
||||
(let ((s5-0 (new-stack-vector0)))
|
||||
(vector-z-quaternion! s5-0 (-> self control unknown-quaternion00))
|
||||
(when (logtest? (-> self control unknown-surface00 flags) (surface-flags surf01))
|
||||
(when (logtest? (-> self control unknown-surface00 flags) (surface-flags dive))
|
||||
(vector-flatten! s5-0 s5-0 (-> self control dynam gravity-normal))
|
||||
(vector-normalize! s5-0 1.0)
|
||||
)
|
||||
@@ -555,7 +555,7 @@
|
||||
(let ((f1-1 (* 0.0625 f1-0)))
|
||||
(set! (-> self control unknown-int10) a0-3)
|
||||
(set! (-> self control unknown-float100) f1-1)
|
||||
(if (logtest? (-> self control unknown-surface01 flags) (surface-flags surf03))
|
||||
(if (logtest? (-> self control unknown-surface01 flags) (surface-flags no-turn-around))
|
||||
(set! (-> v1-6 0) (the-as uint (-> *display* base-frame-counter)))
|
||||
)
|
||||
(and (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> v1-6 0)))) (the-as uint 300))
|
||||
@@ -764,7 +764,7 @@
|
||||
)
|
||||
(if (and (zero? (logand (-> self control status) (cshape-moving-flags twall)))
|
||||
(logtest? (-> self control old-status) (cshape-moving-flags twall))
|
||||
(logtest? (-> self control unknown-surface00 flags) (surface-flags surf11))
|
||||
(logtest? (-> self control unknown-surface00 flags) (surface-flags jump))
|
||||
(< 0.0 (-> gp-0 y))
|
||||
(< 0.0 (vector-dot
|
||||
(-> self control dynam gravity-normal)
|
||||
@@ -783,7 +783,7 @@
|
||||
)
|
||||
(if (and (zero? (logand (-> self control status) (cshape-moving-flags twall)))
|
||||
(and (logtest? (-> self control old-status) (cshape-moving-flags twall))
|
||||
(logtest? (-> self control unknown-surface00 flags) (surface-flags surf11))
|
||||
(logtest? (-> self control unknown-surface00 flags) (surface-flags jump))
|
||||
(< 0.0 (-> gp-0 y))
|
||||
(< (-> gp-0 z) 0.0)
|
||||
)
|
||||
@@ -906,10 +906,10 @@
|
||||
(!= (-> self next-state name) 'target-walk)
|
||||
(< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5))
|
||||
(< (- (-> *display* base-frame-counter) (-> self control unknown-dword21)) (seconds 0.5))
|
||||
(logtest? (-> self control unknown-surface01 flags) (surface-flags surf04))
|
||||
(logtest? (-> self control unknown-surface01 flags) (surface-flags no-rotate-toward-transv))
|
||||
(!= (-> self control unknown-float41) 0.0)
|
||||
)
|
||||
(zero? (logand (-> self control unknown-surface01 flags) (surface-flags surf05)))
|
||||
(zero? (logand (-> self control unknown-surface01 flags) (surface-flags always-rotate-toward-transv)))
|
||||
)
|
||||
(-> self control unknown-vector20)
|
||||
(-> self control transv)
|
||||
@@ -1031,7 +1031,7 @@
|
||||
(zero? (logand (-> *kernel-context* prevent-from-run) (process-mask movie)))
|
||||
)
|
||||
(if (and (= (-> self cam-user-mode) 'normal)
|
||||
(logtest? (-> self control unknown-surface00 flags) (surface-flags surf00))
|
||||
(logtest? (-> self control unknown-surface00 flags) (surface-flags allow-look-around))
|
||||
(zero? (logand (-> self control root-prim prim-core action) (collide-action ca-7 ca-8 ca-9 ca-12 ca-13 ca-14))
|
||||
)
|
||||
(-> *setting-control* current allow-look-around)
|
||||
@@ -1092,7 +1092,7 @@
|
||||
(set! (-> self control surf) *standard-ground-surface*)
|
||||
)
|
||||
(let ((f0-17 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))))
|
||||
(if (and (or (logtest? (-> self control unknown-surface01 flags) (surface-flags surf10))
|
||||
(if (and (or (logtest? (-> self control unknown-surface01 flags) (surface-flags allow-edge-grab))
|
||||
(and (= (-> self next-state name) 'target-walk)
|
||||
(zero? (logand (-> self control status) (cshape-moving-flags onsurf)))
|
||||
)
|
||||
|
||||
@@ -54,16 +54,18 @@
|
||||
)
|
||||
|
||||
(deftype pat-surface (uint32)
|
||||
((skip uint8 :offset 0 :size 3)
|
||||
(mode pat-mode :offset 3 :size 3)
|
||||
(material pat-material :offset 6 :size 6)
|
||||
(camera uint8 :offset 12 :size 2)
|
||||
(event pat-event :offset 14 :size 6)
|
||||
(noentity uint8 :offset 0 :size 1)
|
||||
(nocamera uint8 :offset 1 :size 1)
|
||||
(noedge uint8 :offset 2 :size 1)
|
||||
(nolineofsight uint8 :offset 12 :size 1)
|
||||
(unknown-bit uint8 :offset 15 :size 1)
|
||||
((skip uint8 :offset 0 :size 3) ;; overlay the "no" fields later on
|
||||
(mode pat-mode :offset 3 :size 3) ;; ground/wall/obstacle for collision system
|
||||
(material pat-material :offset 6 :size 6) ;; material for effects (sound, particles, surfaces...)
|
||||
(camera uint8 :offset 12 :size 2) ;; 2 bits for camera (used later)
|
||||
(event pat-event :offset 14 :size 6) ;; what happens if we hit this?
|
||||
(noentity uint8 :offset 0 :size 1) ;; collisions for actors/jak/etc ignore this
|
||||
(nocamera uint8 :offset 1 :size 1) ;; collisions for camera ignore this
|
||||
(noedge uint8 :offset 2 :size 1) ;; seems unused? maybe no edge grab?
|
||||
(nolineofsight uint8 :offset 12 :size 1) ;; camera don't worry about this object blocking line-of-sight to jak.
|
||||
;; 13 belongs to "camera", but seems unsed.
|
||||
;; 14 is unused?
|
||||
(unknown-bit uint8 :offset 15 :size 1) ;; maybe death plane?
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x4
|
||||
@@ -82,6 +84,7 @@
|
||||
(enum->string pat-event (-> pat event))
|
||||
)
|
||||
|
||||
;; for debug drawing pat's by mode.
|
||||
(deftype pat-mode-info (structure)
|
||||
((name string :offset-assert 0)
|
||||
(wall-angle float :offset-assert 4)
|
||||
|
||||
@@ -5,41 +5,43 @@
|
||||
;; name in dgo: surface-h
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
;; A "surface" contains parameters for how Jak will behave.
|
||||
;; It can be used for different in-game surfaces (ice is slippery, grass isn't)
|
||||
;; but is also used for most other changes to Jak's control
|
||||
;; For example, when jumping, there's a separate "surface" for jumping that makes
|
||||
;; Jak less responsive to changing directions.
|
||||
;; Surfaces have flags and parameters that can be combined with other surfaces
|
||||
|
||||
(defenum surface-flags
|
||||
:bitfield #t
|
||||
:type uint32
|
||||
(surf00)
|
||||
(surf01)
|
||||
(surf02)
|
||||
(surf03)
|
||||
(surf04)
|
||||
(surf05)
|
||||
(surf06)
|
||||
(surf07)
|
||||
(surf08)
|
||||
(surf09)
|
||||
(surf10)
|
||||
(surf11)
|
||||
(surf12)
|
||||
(surf13)
|
||||
(surf14)
|
||||
(surf15)
|
||||
(surf16)
|
||||
(surf17)
|
||||
(surf18)
|
||||
(surf19)
|
||||
(surf20)
|
||||
(surf21)
|
||||
(surf22)
|
||||
(surf23)
|
||||
(surf24)
|
||||
(surf25)
|
||||
(surf26)
|
||||
(surf27)
|
||||
(surf28)
|
||||
(surf29)
|
||||
(surf30)
|
||||
(surf31)
|
||||
(allow-look-around) ;; allows entering first person with triangle
|
||||
(dive) ;; set on all diving (dive, dive-bottom) surfaces
|
||||
(surf02) ;; unused
|
||||
(no-turn-around) ;; prevent "changed direction" animation from happening
|
||||
|
||||
;; when jak is on a surface with this flag, the case where jak
|
||||
;; is forced to rotate in the direction he's traveling is
|
||||
;; never taken. It's used on ice (though it is not needed, the turn toward transv
|
||||
;; is disabled by not being in target-walk ever) and also used to prevent
|
||||
;; jak from spinning around when he shouldn't (like if he's knocked back)
|
||||
(no-rotate-toward-transv)
|
||||
;; if jak should always be forced to rotate in the direction he's travelling.
|
||||
;; used for the slides and also the warp gate jump
|
||||
(always-rotate-toward-transv)
|
||||
|
||||
;; never set, but prevents jak from jumping (both normal and roll)
|
||||
(prevent-jump)
|
||||
|
||||
;; target is launch jumping (from a blue eco pad)
|
||||
(prevent-attacks-during-launch-jump)
|
||||
(surf08) ;; never set, prevents various attacks from being possible
|
||||
(surf09) ;; another attack prevent
|
||||
(allow-edge-grab) ;; if set, and jak is falling, turn on the ledge grab search.
|
||||
(jump) ;; set on all jumps, used to prevent "on-grounds" in places
|
||||
(attacking) ;; set on all attacks, but not actually used anywhere
|
||||
(ducking) ;; set on all ducks, but not actually used anywhere
|
||||
(moving-ground) ;; unused, but would make sense if jak was on something moving
|
||||
)
|
||||
|
||||
;; The "surface" defines how jak moves on the ground. It includes things like how fast he can go,
|
||||
@@ -87,7 +89,7 @@
|
||||
:flag-assert #x900000098
|
||||
)
|
||||
|
||||
|
||||
;; these calc-terminal functions are unused.
|
||||
(defun calc-terminal-vel ((arg0 float) (arg1 float) (arg2 float))
|
||||
(- (* (/ (- (* 0.016666668 arg0) arg1) arg2) (- 1.0 arg2)) arg1)
|
||||
)
|
||||
@@ -193,6 +195,8 @@
|
||||
(none)
|
||||
)
|
||||
|
||||
;; The common surfaces:
|
||||
|
||||
(define *walk-mods* (new 'static 'surface
|
||||
:name 'run
|
||||
:turnv 131072.0
|
||||
@@ -217,7 +221,7 @@
|
||||
:alignv 1.0
|
||||
:slope-up-traction 1.0
|
||||
:align-speed 1.0
|
||||
:flags (surface-flags surf00)
|
||||
:flags (surface-flags allow-look-around)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -292,7 +296,7 @@
|
||||
:alignv 1.0
|
||||
:slope-up-traction 1.0
|
||||
:align-speed 1.0
|
||||
:flags (surface-flags surf13)
|
||||
:flags (surface-flags ducking)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -323,7 +327,7 @@
|
||||
:slope-up-traction 1.0
|
||||
:align-speed 1.0
|
||||
:mode 'attack
|
||||
:flags (surface-flags surf12 surf13)
|
||||
:flags (surface-flags attacking ducking)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -352,7 +356,7 @@
|
||||
:slope-up-traction 1.0
|
||||
:align-speed 1.0
|
||||
:mode 'air
|
||||
:flags (surface-flags surf10 surf11)
|
||||
:flags (surface-flags allow-edge-grab jump)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -381,7 +385,7 @@
|
||||
:slope-up-traction 1.0
|
||||
:align-speed 1.0
|
||||
:mode 'air
|
||||
:flags (surface-flags surf10 surf11)
|
||||
:flags (surface-flags allow-edge-grab jump)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -410,7 +414,7 @@
|
||||
:slope-up-traction 1.0
|
||||
:align-speed 1.0
|
||||
:mode 'air
|
||||
:flags (surface-flags surf10 surf11)
|
||||
:flags (surface-flags allow-edge-grab jump)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -439,7 +443,7 @@
|
||||
:slope-up-traction 1.0
|
||||
:align-speed 1.0
|
||||
:mode 'air
|
||||
:flags (surface-flags surf10 surf11)
|
||||
:flags (surface-flags allow-edge-grab jump)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -468,7 +472,7 @@
|
||||
:slope-up-traction 1.0
|
||||
:align-speed 1.0
|
||||
:mode 'air
|
||||
:flags (surface-flags surf07 surf10 surf11)
|
||||
:flags (surface-flags prevent-attacks-during-launch-jump allow-edge-grab jump)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -497,7 +501,7 @@
|
||||
:slope-up-traction 1.0
|
||||
:align-speed 1.0
|
||||
:mode 'air
|
||||
:flags (surface-flags surf10 surf11)
|
||||
:flags (surface-flags allow-edge-grab jump)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -526,7 +530,7 @@
|
||||
:slope-up-traction 1.0
|
||||
:align-speed 1.0
|
||||
:mode 'air
|
||||
:flags (surface-flags surf10 surf11)
|
||||
:flags (surface-flags allow-edge-grab jump)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -555,7 +559,7 @@
|
||||
:slope-up-traction 1.0
|
||||
:align-speed 1.0
|
||||
:mode 'air
|
||||
:flags (surface-flags surf10 surf11)
|
||||
:flags (surface-flags allow-edge-grab jump)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -584,7 +588,7 @@
|
||||
:slope-up-traction 1.0
|
||||
:align-speed 1.0
|
||||
:mode 'air
|
||||
:flags (surface-flags surf10 surf11)
|
||||
:flags (surface-flags allow-edge-grab jump)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -611,7 +615,7 @@
|
||||
:slope-up-traction 1.0
|
||||
:align-speed 1.0
|
||||
:mode 'attack
|
||||
:flags (surface-flags surf12)
|
||||
:flags (surface-flags attacking)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -639,7 +643,7 @@
|
||||
:slope-up-traction 1.0
|
||||
:align-speed 1.0
|
||||
:mode 'air
|
||||
:flags (surface-flags surf10 surf11 surf12)
|
||||
:flags (surface-flags allow-edge-grab jump attacking)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -667,7 +671,7 @@
|
||||
:slope-up-traction 1.0
|
||||
:align-speed 1.0
|
||||
:mode 'air
|
||||
:flags (surface-flags surf10 surf11 surf12)
|
||||
:flags (surface-flags allow-edge-grab jump attacking)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -695,7 +699,9 @@
|
||||
:slope-up-traction 1.0
|
||||
:align-speed 1.0
|
||||
:mode 'attack
|
||||
:flags (surface-flags surf03 surf04 surf12)
|
||||
;; no-rotate-toward-transv prevents jak from spinning around
|
||||
;; if you punch over bumpy terrain
|
||||
:flags (surface-flags no-turn-around no-rotate-toward-transv attacking)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -722,7 +728,7 @@
|
||||
:slope-up-traction 1.0
|
||||
:align-speed 1.0
|
||||
:mode 'attack
|
||||
:flags (surface-flags surf12)
|
||||
:flags (surface-flags attacking)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -746,7 +752,7 @@
|
||||
:slope-up-traction 1.0
|
||||
:align-speed 1.0
|
||||
:mode 'attack
|
||||
:flags (surface-flags surf10 surf11 surf12)
|
||||
:flags (surface-flags allow-edge-grab jump attacking)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -771,7 +777,7 @@
|
||||
:slope-up-traction 1.0
|
||||
:align-speed 1.0
|
||||
:mode 'attack
|
||||
:flags (surface-flags surf11 surf12)
|
||||
:flags (surface-flags jump attacking)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -800,7 +806,7 @@
|
||||
:slope-up-traction 1.0
|
||||
:align-speed 1.0
|
||||
:mode 'air
|
||||
:flags (surface-flags surf11)
|
||||
:flags (surface-flags jump)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -833,7 +839,7 @@
|
||||
:slope-up-traction 1.0
|
||||
:align-speed 1.0
|
||||
:mode 'wade
|
||||
:flags (surface-flags surf00)
|
||||
:flags (surface-flags allow-look-around)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -884,7 +890,7 @@
|
||||
:alignv 1.0
|
||||
:align-speed 1.0
|
||||
:mode 'dive
|
||||
:flags (surface-flags surf01)
|
||||
:flags (surface-flags dive)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -913,7 +919,7 @@
|
||||
:slope-up-traction 1.0
|
||||
:align-speed 1.0
|
||||
:mode 'dive
|
||||
:flags (surface-flags surf01)
|
||||
:flags (surface-flags dive)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1190,7 +1196,7 @@
|
||||
:alignv 1.0
|
||||
:slope-up-traction 1.0
|
||||
:align-speed 1.0
|
||||
:flags (surface-flags surf03 surf04)
|
||||
:flags (surface-flags no-turn-around no-rotate-toward-transv)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -496,7 +496,7 @@
|
||||
(none)
|
||||
)
|
||||
:mode 'air
|
||||
:flags (surface-flags surf11)
|
||||
:flags (surface-flags jump)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -541,7 +541,7 @@
|
||||
(none)
|
||||
)
|
||||
:mode 'air
|
||||
:flags (surface-flags surf03 surf04 surf11)
|
||||
:flags (surface-flags no-turn-around no-rotate-toward-transv jump)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -620,7 +620,7 @@
|
||||
(the-as time-frame (-> *TARGET-bank* stuck-timeout))
|
||||
)
|
||||
(zero? (logand (-> self state-flags) (state-flags sf12)))
|
||||
(zero? (logand (-> self control unknown-surface01 flags) (surface-flags surf07 surf08)))
|
||||
(zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)))
|
||||
)
|
||||
)
|
||||
(go
|
||||
|
||||
@@ -230,13 +230,13 @@
|
||||
(cond
|
||||
((-> arg3 param 0)
|
||||
(let ((v1-108 (-> self draw shadow-ctrl)))
|
||||
(logclear! (-> v1-108 settings flags) (shadow-flags shdf05))
|
||||
(logclear! (-> v1-108 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
)
|
||||
(else
|
||||
(let ((v1-110 (-> self draw shadow-ctrl)))
|
||||
(logior! (-> v1-110 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-110 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
)
|
||||
@@ -823,7 +823,7 @@
|
||||
)
|
||||
)
|
||||
(('loading)
|
||||
(if (not (or (and (logtest? (-> self control unknown-surface00 flags) (surface-flags surf11))
|
||||
(if (not (or (and (logtest? (-> self control unknown-surface00 flags) (surface-flags jump))
|
||||
(zero? (logand (-> self control status) (cshape-moving-flags onsurf)))
|
||||
)
|
||||
(or (logtest? (-> self water flags) (water-flags wt09))
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
(define *target-shadow-control*
|
||||
(new 'static 'shadow-control :settings (new 'static 'shadow-settings
|
||||
:center (new 'static 'vector :w (the-as float #x2))
|
||||
:flags (shadow-flags disable-fade)
|
||||
:shadow-dir (new 'static 'vector :x -0.4226 :y -0.9063 :w 409600.0)
|
||||
:bot-plane (new 'static 'plane :y 1.0 :w 37683.2)
|
||||
:top-plane (new 'static 'plane :y 1.0 :w 4096.0)
|
||||
@@ -739,7 +739,7 @@
|
||||
(< 0.866 (-> self control surface-angle))
|
||||
)
|
||||
)
|
||||
(and (zero? (logand (-> self control unknown-surface01 flags) (surface-flags surf06)))
|
||||
(and (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-jump)))
|
||||
(zero? (logand (-> self state-flags) (state-flags sf11)))
|
||||
(case arg0
|
||||
(('target-wheel-flip)
|
||||
@@ -776,7 +776,7 @@
|
||||
)
|
||||
)
|
||||
(when (and (< (- (-> *display* base-frame-counter) (-> self control rider-time)) (-> *TARGET-bank* ground-timeout))
|
||||
(logtest? (-> self control unknown-surface01 flags) (surface-flags surf14))
|
||||
(logtest? (-> self control unknown-surface01 flags) (surface-flags moving-ground))
|
||||
)
|
||||
(+! (-> self control transv x) (-> self control rider-last-move x))
|
||||
(+! (-> self control transv z) (-> self control rider-last-move z))
|
||||
@@ -843,7 +843,7 @@
|
||||
(set! (-> gp-0 num-spheres) (the-as uint 2))
|
||||
(set! (-> gp-0 collide-with) (-> self control root-prim collide-with))
|
||||
(set! (-> gp-0 proc) #f)
|
||||
(set! (-> gp-0 ignore-pat) (the-as uint 1))
|
||||
(set! (-> gp-0 ignore-pat) (new 'static 'pat-surface :noentity #x1))
|
||||
(set! (-> gp-0 solid-only) #t)
|
||||
(if (fill-and-probe-using-spheres *collide-cache* gp-0)
|
||||
#f
|
||||
@@ -866,7 +866,7 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(logtest? (-> self control unknown-surface01 flags) (surface-flags surf07 surf08))
|
||||
(logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08))
|
||||
)
|
||||
)
|
||||
#f
|
||||
@@ -899,7 +899,7 @@
|
||||
(defbehavior can-feet? target ()
|
||||
(cond
|
||||
((or (logtest? (-> self state-flags) (state-flags sf12))
|
||||
(logtest? (-> self control unknown-surface01 flags) (surface-flags surf07 surf09))
|
||||
(logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf09))
|
||||
)
|
||||
#f
|
||||
)
|
||||
|
||||
@@ -942,7 +942,7 @@
|
||||
)
|
||||
)
|
||||
(set! (-> self skel root-channel 6 frame-interp) f30-0)
|
||||
(let* ((f1-19 (dummy-9 (-> self skel)))
|
||||
(let* ((f1-19 (current-cycle-distance (-> self skel)))
|
||||
(f0-92 (/ (-> self control unknown-float01) (* 60.0 (/ f1-19 (-> *TARGET-bank* run-cycle-length)))))
|
||||
)
|
||||
(ja :num! (loop! f0-92))
|
||||
@@ -1080,7 +1080,7 @@
|
||||
(set! arg0 (+ arg0 f0-1))
|
||||
(set! arg1 (+ arg1 f0-1))
|
||||
)
|
||||
(when (or (logtest? (-> self control unknown-surface01 flags) (surface-flags surf14))
|
||||
(when (or (logtest? (-> self control unknown-surface01 flags) (surface-flags moving-ground))
|
||||
(= (-> self control poly-pat material) (pat-material rotate))
|
||||
)
|
||||
(+! (-> self control transv x) (-> self control rider-last-move x))
|
||||
@@ -1474,7 +1474,7 @@
|
||||
(the-as time-frame (-> *TARGET-bank* stuck-timeout))
|
||||
)
|
||||
(zero? (logand (-> self state-flags) (state-flags sf12)))
|
||||
(zero? (logand (-> self control unknown-surface01 flags) (surface-flags surf07 surf08)))
|
||||
(zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)))
|
||||
)
|
||||
)
|
||||
(go
|
||||
@@ -1594,7 +1594,7 @@
|
||||
(the-as time-frame (-> *TARGET-bank* stuck-timeout))
|
||||
)
|
||||
(zero? (logand (-> self state-flags) (state-flags sf12)))
|
||||
(zero? (logand (-> self control unknown-surface01 flags) (surface-flags surf07 surf08)))
|
||||
(zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)))
|
||||
)
|
||||
)
|
||||
(go
|
||||
@@ -1693,7 +1693,7 @@
|
||||
(the-as time-frame (-> *TARGET-bank* stuck-timeout))
|
||||
)
|
||||
(zero? (logand (-> self state-flags) (state-flags sf12)))
|
||||
(zero? (logand (-> self control unknown-surface01 flags) (surface-flags surf07 surf08)))
|
||||
(zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)))
|
||||
)
|
||||
)
|
||||
(go
|
||||
@@ -2156,7 +2156,7 @@
|
||||
)
|
||||
)
|
||||
(zero? (logand (-> self state-flags) (state-flags sf11 sf12)))
|
||||
(zero? (logand (-> self control unknown-surface01 flags) (surface-flags surf07)))
|
||||
(zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump)))
|
||||
)
|
||||
)
|
||||
(go
|
||||
@@ -2541,7 +2541,7 @@
|
||||
(the-as time-frame (-> *TARGET-bank* stuck-timeout))
|
||||
)
|
||||
(zero? (logand (-> self state-flags) (state-flags sf12)))
|
||||
(zero? (logand (-> self control unknown-surface01 flags) (surface-flags surf07 surf08)))
|
||||
(zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)))
|
||||
)
|
||||
)
|
||||
(set-quaternion! (-> self control) (-> self control dir-targ))
|
||||
@@ -2883,7 +2883,7 @@
|
||||
(set! (-> self control unknown-uint20) (the-as uint arg0))
|
||||
(set-forward-vel (the-as float 0.0))
|
||||
(set! (-> self control unknown-surface00) *flop-land-mods*)
|
||||
(logclear! (-> *flop-land-mods* flags) (surface-flags surf10))
|
||||
(logclear! (-> *flop-land-mods* flags) (surface-flags allow-edge-grab))
|
||||
(set! (-> self state-flags) (logior (state-flags sf20) (-> self state-flags)))
|
||||
(none)
|
||||
)
|
||||
@@ -2914,7 +2914,7 @@
|
||||
(if (and (or (= v1-33 eichar-flop-down-land-ja) (= v1-33 eichar-moving-flop-down-land-ja))
|
||||
(>= (ja-aframe-num 0) 28.0)
|
||||
)
|
||||
(logior! (-> *flop-land-mods* flags) (surface-flags surf10))
|
||||
(logior! (-> *flop-land-mods* flags) (surface-flags allow-edge-grab))
|
||||
)
|
||||
)
|
||||
(slide-down-test)
|
||||
|
||||
@@ -1175,7 +1175,7 @@
|
||||
(set! (-> a1-2 num-spheres) (the-as uint 6))
|
||||
(set! (-> a1-2 collide-with) (-> self control root-prim collide-with))
|
||||
(set! (-> a1-2 proc) #f)
|
||||
(set! (-> a1-2 ignore-pat) (the-as uint 1))
|
||||
(set! (-> a1-2 ignore-pat) (new 'static 'pat-surface :noentity #x1))
|
||||
(set! (-> a1-2 solid-only) #t)
|
||||
(when (not (fill-and-probe-using-spheres *collide-cache* a1-2))
|
||||
(remove-exit)
|
||||
@@ -1309,7 +1309,7 @@
|
||||
(logclear! (-> self control root-prim prim-core action) (collide-action ca-3 ca-7))
|
||||
(vector-float*! (-> self control transv) (-> self control unknown-vector101) -40960.0)
|
||||
(when (and (< (- (-> *display* base-frame-counter) (-> self control rider-time)) (seconds 0.2))
|
||||
(or (logtest? (-> self control unknown-surface01 flags) (surface-flags surf14))
|
||||
(or (logtest? (-> self control unknown-surface01 flags) (surface-flags moving-ground))
|
||||
(= (-> self control poly-pat material) (pat-material rotate))
|
||||
)
|
||||
)
|
||||
@@ -1467,7 +1467,7 @@
|
||||
:slope-up-traction 1.0
|
||||
:align-speed 1.0
|
||||
:mode 'air
|
||||
:flags (surface-flags surf11)
|
||||
:flags (surface-flags jump)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1878,7 +1878,7 @@
|
||||
)
|
||||
(set! (-> self skel root-channel 1 frame-interp) f24-1)
|
||||
(ja :num! (loop! (/ (-> self control unknown-float01)
|
||||
(* 60.0 (/ (dummy-9 (-> self skel)) (-> *TARGET-bank* run-cycle-length)))
|
||||
(* 60.0 (/ (current-cycle-distance (-> self skel)) (-> *TARGET-bank* run-cycle-length)))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -51,14 +51,14 @@
|
||||
(logtest? (-> obj draw status) (draw-status was-drawn))
|
||||
)
|
||||
(let ((v1-9 (-> obj draw shadow-ctrl)))
|
||||
(logclear! (-> v1-9 settings flags) (shadow-flags shdf05))
|
||||
(logclear! (-> v1-9 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(update-direction-from-time-of-day (-> obj draw shadow-ctrl))
|
||||
)
|
||||
(else
|
||||
(let ((v1-14 (-> obj draw shadow-ctrl)))
|
||||
(logior! (-> v1-14 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-14 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
)
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
(logtest? (-> obj draw status) (draw-status was-drawn))
|
||||
)
|
||||
(let ((v1-9 (-> obj draw shadow-ctrl)))
|
||||
(logclear! (-> v1-9 settings flags) (shadow-flags shdf05))
|
||||
(logclear! (-> v1-9 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(update-direction-from-time-of-day (-> obj draw shadow-ctrl))
|
||||
|
||||
@@ -56,14 +56,14 @@
|
||||
(logtest? (-> obj draw status) (draw-status was-drawn))
|
||||
)
|
||||
(let ((v1-9 (-> obj draw shadow-ctrl)))
|
||||
(logclear! (-> v1-9 settings flags) (shadow-flags shdf05))
|
||||
(logclear! (-> v1-9 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(update-direction-from-time-of-day (-> obj draw shadow-ctrl))
|
||||
)
|
||||
(else
|
||||
(let ((v1-14 (-> obj draw shadow-ctrl)))
|
||||
(logior! (-> v1-14 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-14 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
@@ -984,7 +985,7 @@
|
||||
(collide-kind background)
|
||||
self
|
||||
s5-0
|
||||
1
|
||||
(new 'static 'pat-surface :noentity #x1)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -492,14 +492,14 @@
|
||||
(logtest? (-> obj draw status) (draw-status was-drawn))
|
||||
)
|
||||
(let ((v1-9 (-> obj draw shadow-ctrl)))
|
||||
(logclear! (-> v1-9 settings flags) (shadow-flags shdf05))
|
||||
(logclear! (-> v1-9 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(update-direction-from-time-of-day (-> obj draw shadow-ctrl))
|
||||
)
|
||||
(else
|
||||
(let ((v1-14 (-> obj draw shadow-ctrl)))
|
||||
(logior! (-> v1-14 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-14 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
)
|
||||
@@ -605,14 +605,14 @@
|
||||
(logtest? (-> obj draw status) (draw-status was-drawn))
|
||||
)
|
||||
(let ((v1-9 (-> obj draw shadow-ctrl)))
|
||||
(logclear! (-> v1-9 settings flags) (shadow-flags shdf05))
|
||||
(logclear! (-> v1-9 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(update-direction-from-time-of-day (-> obj draw shadow-ctrl))
|
||||
)
|
||||
(else
|
||||
(let ((v1-14 (-> obj draw shadow-ctrl)))
|
||||
(logior! (-> v1-14 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-14 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
)
|
||||
@@ -723,14 +723,14 @@
|
||||
(logtest? (-> obj draw status) (draw-status was-drawn))
|
||||
)
|
||||
(let ((v1-9 (-> obj draw shadow-ctrl)))
|
||||
(logclear! (-> v1-9 settings flags) (shadow-flags shdf05))
|
||||
(logclear! (-> v1-9 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(update-direction-from-time-of-day (-> obj draw shadow-ctrl))
|
||||
)
|
||||
(else
|
||||
(let ((v1-14 (-> obj draw shadow-ctrl)))
|
||||
(logior! (-> v1-14 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-14 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
)
|
||||
|
||||
@@ -507,7 +507,7 @@
|
||||
;; we add "training" to the list here so that the training warp gate waits until it's safe to
|
||||
;; dispose the old code from memory.
|
||||
(case (-> self level)
|
||||
(('citadel 'lavatube 'training)
|
||||
(('citadel 'lavatube 'training)
|
||||
(while (and *target* (zero? (logand (-> *target* draw status) (draw-status hidden))))
|
||||
(suspend)
|
||||
)
|
||||
@@ -550,7 +550,7 @@
|
||||
:slope-up-traction 1.0
|
||||
:align-speed 1.0
|
||||
:mode 'air
|
||||
:flags (surface-flags surf05)
|
||||
:flags (surface-flags always-rotate-toward-transv)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -424,7 +424,7 @@
|
||||
(s3-0 (new 'stack-no-clear 'collide-tri-result))
|
||||
)
|
||||
(vector-! a2-1 s4-0 (-> s5-1 prev-pos))
|
||||
(when (>= (probe-using-line-sphere *collide-cache* (-> s5-1 prev-pos) a2-1 40.96 (collide-kind background) s3-0 1)
|
||||
(when (>= (probe-using-line-sphere *collide-cache* (-> s5-1 prev-pos) a2-1 40.96 (collide-kind background) s3-0 (new 'static 'pat-surface :noentity #x1))
|
||||
0.0
|
||||
)
|
||||
(set! (-> s4-0 quad) (-> s3-0 intersect quad))
|
||||
|
||||
@@ -1705,7 +1705,7 @@ nav-enemy-default-event-handler
|
||||
|
||||
(define *nav-enemy-dummy-shadow-control*
|
||||
(new 'static 'shadow-control :settings (new 'static 'shadow-settings
|
||||
:center (new 'static 'vector :w (the-as float #x28))
|
||||
:flags (shadow-flags shdf03 disable-draw)
|
||||
:shadow-dir (new 'static 'vector :y -1.0 :w 614400.0)
|
||||
:bot-plane (new 'static 'plane :y 1.0 :w 4096.0)
|
||||
:top-plane (new 'static 'plane :y 1.0 :w -4096.0)
|
||||
|
||||
@@ -198,7 +198,7 @@
|
||||
(when (-> self go-back-if-lost-player?)
|
||||
(when (or (not *target*)
|
||||
(and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4))
|
||||
(not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags surf11))
|
||||
(not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump))
|
||||
(zero? (logand (-> *target* control status) (cshape-moving-flags onsurf)))
|
||||
)
|
||||
)
|
||||
@@ -272,7 +272,7 @@
|
||||
(when (-> self go-back-if-lost-player?)
|
||||
(when (or (not *target*)
|
||||
(and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4))
|
||||
(not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags surf11))
|
||||
(not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump))
|
||||
(zero? (logand (-> *target* control status) (cshape-moving-flags onsurf)))
|
||||
)
|
||||
)
|
||||
|
||||
@@ -434,7 +434,7 @@
|
||||
(v1-7 (-> obj draw shadow-ctrl))
|
||||
)
|
||||
(let ((a0-1 v1-7))
|
||||
(logclear! (-> a0-1 settings flags) (shadow-flags shdf05))
|
||||
(logclear! (-> a0-1 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(let ((a0-3 v1-7))
|
||||
@@ -447,7 +447,7 @@
|
||||
)
|
||||
(else
|
||||
(let ((v1-9 (-> obj draw shadow-ctrl)))
|
||||
(logior! (-> v1-9 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-9 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
)
|
||||
@@ -582,7 +582,7 @@
|
||||
0
|
||||
(logclear! (-> v1-4 settings flags) (shadow-flags shdf03))
|
||||
(logclear! (-> v1-4 settings flags) (shadow-flags shdf02))
|
||||
(logclear! (-> v1-4 settings flags) (shadow-flags shdf05))
|
||||
(logclear! (-> v1-4 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(ja-channel-push! 1 (seconds 0.2))
|
||||
@@ -681,7 +681,7 @@
|
||||
(sound-play-by-name (static-sound-name "blob-explode") (new-sound-id) 1024 0 0 1 #t)
|
||||
(activate! *camera-smush-control* 409.6 37 150 1.0 0.99)
|
||||
(let ((v1-14 (-> self draw shadow-ctrl)))
|
||||
(logior! (-> v1-14 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-14 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(let ((t9-7 (-> (method-of-type nav-enemy nav-enemy-die) enter)))
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
((or (not (ja-group? arg2)) (< f0-0 arg0) (< arg1 f0-0))
|
||||
(robotboss-cut-cam-exit)
|
||||
)
|
||||
((or (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags surf11))
|
||||
((or (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump))
|
||||
(zero? (logand (-> *target* control status) (cshape-moving-flags onsurf)))
|
||||
)
|
||||
(-> self skip-cut)
|
||||
@@ -2352,7 +2352,7 @@
|
||||
(collide-kind target)
|
||||
self
|
||||
t2-0
|
||||
1
|
||||
(new 'static 'pat-surface :noentity #x1)
|
||||
)
|
||||
0.0
|
||||
)
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
|
||||
(define *flutflut-shadow-control*
|
||||
(new 'static 'shadow-control :settings (new 'static 'shadow-settings
|
||||
:center (new 'static 'vector :w (the-as float #xa))
|
||||
:flags (shadow-flags disable-fade shdf03)
|
||||
:shadow-dir (new 'static 'vector :y -1.0 :w 614400.0)
|
||||
:bot-plane (new 'static 'plane :y 1.0 :w 81920.0)
|
||||
:top-plane (new 'static 'plane :y 1.0 :w -2867.2)
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
:alignv 1.0
|
||||
:slope-up-traction 1.0
|
||||
:align-speed 1.0
|
||||
:flags (surface-flags surf03)
|
||||
:flags (surface-flags no-turn-around)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
:slope-up-traction 1.0
|
||||
:align-speed 1.0
|
||||
:mode 'air
|
||||
:flags (surface-flags surf11)
|
||||
:flags (surface-flags jump)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
:slope-up-traction 1.0
|
||||
:align-speed 1.0
|
||||
:mode 'air
|
||||
:flags (surface-flags surf11)
|
||||
:flags (surface-flags jump)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -151,7 +151,7 @@
|
||||
:slope-up-traction 1.0
|
||||
:align-speed 1.0
|
||||
:mode 'attack
|
||||
:flags (surface-flags surf03 surf04 surf12)
|
||||
:flags (surface-flags no-turn-around no-rotate-toward-transv attacking)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -176,7 +176,7 @@
|
||||
:slope-up-traction 1.0
|
||||
:align-speed 1.0
|
||||
:mode 'attack
|
||||
:flags (surface-flags surf11 surf12)
|
||||
:flags (surface-flags jump attacking)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -729,9 +729,10 @@
|
||||
(set! f30-0 (seek f30-0 f0-13 (* 4.0 (-> *display* seconds-per-frame))))
|
||||
)
|
||||
(set! (-> self skel root-channel 1 frame-interp) f30-0)
|
||||
(let* ((f0-16 (dummy-9 (-> self skel)))
|
||||
(let* ((f0-16 (current-cycle-distance (-> self skel)))
|
||||
(f0-18 (/ (* 58.0 (-> self control unknown-float01)) (* 60.0 f0-16)))
|
||||
)
|
||||
(format *stdcon* "~% val: ~f~%" f0-16)
|
||||
(if (= (-> self control surf name) '*tar-surface*)
|
||||
(set! f0-18 (* 0.4 (-> self control unknown-float12)))
|
||||
)
|
||||
@@ -834,7 +835,7 @@
|
||||
(the-as time-frame (-> *TARGET-bank* stuck-timeout))
|
||||
)
|
||||
(zero? (logand (-> self state-flags) (state-flags sf12)))
|
||||
(zero? (logand (-> self control unknown-surface01 flags) (surface-flags surf07 surf08)))
|
||||
(zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)))
|
||||
)
|
||||
)
|
||||
(go target-flut-air-attack (-> *FLUT-bank* air-attack-speed))
|
||||
@@ -947,7 +948,7 @@
|
||||
(pad-buttons square)
|
||||
)
|
||||
(and (zero? (logand (-> self state-flags) (state-flags sf12)))
|
||||
(zero? (logand (-> self control unknown-surface01 flags) (surface-flags surf07 surf08)))
|
||||
(zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)))
|
||||
(>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36))
|
||||
(the-as time-frame (-> *TARGET-bank* stuck-timeout))
|
||||
)
|
||||
|
||||
@@ -829,14 +829,14 @@
|
||||
(logtest? (-> obj draw status) (draw-status was-drawn))
|
||||
)
|
||||
(let ((v1-9 (-> obj draw shadow-ctrl)))
|
||||
(logclear! (-> v1-9 settings flags) (shadow-flags shdf05))
|
||||
(logclear! (-> v1-9 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(update-direction-from-time-of-day (-> obj draw shadow-ctrl))
|
||||
)
|
||||
(else
|
||||
(let ((v1-14 (-> obj draw shadow-ctrl)))
|
||||
(logior! (-> v1-14 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-14 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
)
|
||||
|
||||
@@ -1291,7 +1291,7 @@
|
||||
:event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
||||
(case arg2
|
||||
(('touch)
|
||||
(when (and *target* (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags surf11))
|
||||
(when (and *target* (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump))
|
||||
(zero? (logand (-> *target* control status) (cshape-moving-flags onsurf)))
|
||||
)
|
||||
)
|
||||
@@ -2025,7 +2025,7 @@
|
||||
(collide-kind target)
|
||||
(the-as process #f)
|
||||
t2-0
|
||||
1
|
||||
(new 'static 'pat-surface :noentity #x1)
|
||||
)
|
||||
0.0
|
||||
)
|
||||
|
||||
@@ -157,7 +157,7 @@
|
||||
|
||||
(define *plant-boss-shadow-control*
|
||||
(new 'static 'shadow-control :settings (new 'static 'shadow-settings
|
||||
:center (new 'static 'vector :w (the-as float #x2))
|
||||
:flags (shadow-flags disable-fade)
|
||||
:shadow-dir (new 'static 'vector :y -1.0 :w 409600.0)
|
||||
:bot-plane (new 'static 'plane :y 1.0 :w 37683.2)
|
||||
:top-plane (new 'static 'plane :y 1.0 :w 4096.0)
|
||||
|
||||
@@ -582,7 +582,7 @@
|
||||
(when (>= (-> obj explode-danger-radius) (vector-vector-distance s5-0 s3-0))
|
||||
(vector-! s4-0 s3-0 s5-0)
|
||||
(let ((t2-0 (new 'stack-no-clear 'collide-tri-result)))
|
||||
(if (< (fill-and-probe-using-line-sphere *collide-cache* s5-0 s4-0 819.2 (collide-kind background) obj t2-0 1)
|
||||
(if (< (fill-and-probe-using-line-sphere *collide-cache* s5-0 s4-0 819.2 (collide-kind background) obj t2-0 (new 'static 'pat-surface :noentity #x1))
|
||||
0.0
|
||||
)
|
||||
(send-event *target* 'attack #f (new 'static 'attack-info))
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
|
||||
(define *driller-lurker-shadow-control*
|
||||
(new 'static 'shadow-control :settings (new 'static 'shadow-settings
|
||||
:center (new 'static 'vector :w (the-as float #x9))
|
||||
:flags (shadow-flags shdf00 shdf03)
|
||||
:shadow-dir (new 'static 'vector :y -1.0 :w 614400.0)
|
||||
:bot-plane (new 'static 'plane :y 1.0 :w 4096.0)
|
||||
:top-plane (new 'static 'plane :y 1.0 :w -2048.0)
|
||||
|
||||
@@ -276,7 +276,7 @@
|
||||
(until (or (or (not *target*)
|
||||
(< 28672.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))
|
||||
)
|
||||
(and (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags surf11))
|
||||
(and (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump))
|
||||
(zero? (logand (-> *target* control status) (cshape-moving-flags onsurf)))
|
||||
)
|
||||
)
|
||||
@@ -293,7 +293,7 @@
|
||||
(ja-no-eval :group! (-> self draw art-group data 8) :num! (seek!) :frame-num 0.0)
|
||||
(until (ja-done? 0)
|
||||
(when (and (and *target* (>= 28672.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))))
|
||||
(or (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags surf11))
|
||||
(or (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump))
|
||||
(zero? (logand (-> *target* control status) (cshape-moving-flags onsurf)))
|
||||
)
|
||||
(logtest? (-> *target* control root-prim prim-core action) (collide-action ca-7))
|
||||
|
||||
@@ -180,11 +180,11 @@
|
||||
(set! (-> a1-1 y) (+ 1228.8 (-> a1-1 y)))
|
||||
(set-vector! a2-1 0.0 -61440.0 0.0 1.0)
|
||||
(cond
|
||||
((>= (fill-and-probe-using-line-sphere *collide-cache* a1-1 a2-1 7372.8 (collide-kind background) obj s5-0 1)
|
||||
((>= (fill-and-probe-using-line-sphere *collide-cache* a1-1 a2-1 7372.8 (collide-kind background) obj s5-0 (new 'static 'pat-surface :noentity #x1))
|
||||
0.0
|
||||
)
|
||||
(let ((v1-11 (-> obj draw shadow-ctrl)))
|
||||
(logclear! (-> v1-11 settings flags) (shadow-flags shdf05))
|
||||
(logclear! (-> v1-11 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(let ((v1-14 (-> obj draw shadow-ctrl)))
|
||||
@@ -199,7 +199,7 @@
|
||||
)
|
||||
(else
|
||||
(let ((v1-22 (-> obj draw shadow-ctrl)))
|
||||
(logior! (-> v1-22 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-22 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
)
|
||||
@@ -208,7 +208,7 @@
|
||||
)
|
||||
(else
|
||||
(let ((v1-25 (-> obj draw shadow-ctrl)))
|
||||
(logior! (-> v1-25 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-25 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
)
|
||||
@@ -374,7 +374,7 @@
|
||||
(ja :num! (seek!))
|
||||
)
|
||||
(let ((v1-37 (-> self draw shadow-ctrl)))
|
||||
(logior! (-> v1-37 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-37 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(go mother-spider-egg-die-exit)
|
||||
@@ -387,7 +387,7 @@
|
||||
:code (behavior ()
|
||||
(logclear! (-> self mask) (process-mask actor-pause))
|
||||
(let ((v1-3 (-> self draw shadow-ctrl)))
|
||||
(logior! (-> v1-3 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-3 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(lods-assign! (-> self draw) (-> self broken-look))
|
||||
@@ -429,7 +429,7 @@
|
||||
(logclear! (-> self mask) (process-mask actor-pause))
|
||||
(clear-collide-with-as (-> self root-override))
|
||||
(let ((v1-5 (-> self draw shadow-ctrl)))
|
||||
(logior! (-> v1-5 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-5 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(process-spawn
|
||||
@@ -461,7 +461,7 @@
|
||||
(send-event (ppointer->process (-> self parent-override)) 'untrigger)
|
||||
(logior! (-> self draw status) (draw-status hidden))
|
||||
(let ((v1-8 (-> self draw shadow-ctrl)))
|
||||
(logior! (-> v1-8 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-8 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(logclear! (-> self root-override nav-flags) (nav-flags navf0))
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
(collide-kind background)
|
||||
self
|
||||
gp-0
|
||||
1
|
||||
(new 'static 'pat-surface :noentity #x1)
|
||||
)
|
||||
0.0
|
||||
)
|
||||
@@ -360,7 +360,7 @@
|
||||
)
|
||||
|
||||
(defmethod is-player-stuck? mother-spider ((obj mother-spider))
|
||||
(when (and *target* (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags surf11))
|
||||
(when (and *target* (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump))
|
||||
(zero? (logand (-> *target* control status) (cshape-moving-flags onsurf)))
|
||||
)
|
||||
)
|
||||
@@ -401,11 +401,11 @@
|
||||
(set-vector! a2-0 0.0 -81920.0 0.0 1.0)
|
||||
(set! (-> a1-0 y) (+ -8192.0 (-> a1-0 y)))
|
||||
(cond
|
||||
((>= (fill-and-probe-using-line-sphere *collide-cache* a1-0 a2-0 8192.0 (collide-kind background) obj s5-0 1)
|
||||
((>= (fill-and-probe-using-line-sphere *collide-cache* a1-0 a2-0 8192.0 (collide-kind background) obj s5-0 (new 'static 'pat-surface :noentity #x1))
|
||||
0.0
|
||||
)
|
||||
(let ((v1-11 (-> obj draw shadow-ctrl)))
|
||||
(logclear! (-> v1-11 settings flags) (shadow-flags shdf05))
|
||||
(logclear! (-> v1-11 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(let ((v1-14 (-> obj draw shadow-ctrl)))
|
||||
@@ -426,7 +426,7 @@
|
||||
)
|
||||
(else
|
||||
(let ((v1-23 (-> obj draw shadow-ctrl)))
|
||||
(logior! (-> v1-23 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-23 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
)
|
||||
@@ -435,7 +435,7 @@
|
||||
)
|
||||
(else
|
||||
(let ((v1-25 (-> obj draw shadow-ctrl)))
|
||||
(logior! (-> v1-25 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-25 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
)
|
||||
@@ -702,7 +702,7 @@
|
||||
(collide-kind background)
|
||||
obj
|
||||
(the-as collide-tri-result s5-1)
|
||||
1
|
||||
(new 'static 'pat-surface :noentity #x1)
|
||||
)
|
||||
0.0
|
||||
)
|
||||
@@ -803,7 +803,7 @@
|
||||
(defstate mother-spider-idle (mother-spider)
|
||||
:enter (behavior ()
|
||||
(let ((v1-1 (-> self draw shadow-ctrl)))
|
||||
(logior! (-> v1-1 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-1 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(set! (-> self mode) (the-as uint 0))
|
||||
@@ -1035,7 +1035,7 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(if (or (not *target*) (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags surf11))
|
||||
(if (or (not *target*) (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump))
|
||||
(zero? (logand (-> *target* control status) (cshape-moving-flags onsurf)))
|
||||
)
|
||||
)
|
||||
@@ -1412,7 +1412,7 @@
|
||||
(collide-kind background)
|
||||
obj
|
||||
s2-2
|
||||
1
|
||||
(new 'static 'pat-surface :noentity #x1)
|
||||
)
|
||||
0.0
|
||||
)
|
||||
@@ -1446,7 +1446,7 @@
|
||||
(collide-kind background)
|
||||
obj
|
||||
s3-2
|
||||
1
|
||||
(new 'static 'pat-surface :noentity #x1)
|
||||
)
|
||||
0.0
|
||||
)
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
:slope-up-traction 1.0
|
||||
:align-speed 1.0
|
||||
:mode 'air
|
||||
:flags (surface-flags surf10 surf11)
|
||||
:flags (surface-flags allow-edge-grab jump)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -283,7 +283,7 @@
|
||||
(cond
|
||||
((>= (vector4-dot (camera-pos) (-> self shadow-enable-plane)) 0.0)
|
||||
(let ((v1-32 (-> self draw shadow-ctrl)))
|
||||
(logclear! (-> v1-32 settings flags) (shadow-flags shdf05))
|
||||
(logclear! (-> v1-32 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(let ((v1-35 (-> self draw shadow-ctrl)))
|
||||
@@ -297,7 +297,7 @@
|
||||
)
|
||||
(else
|
||||
(let ((v1-41 (-> self draw shadow-ctrl)))
|
||||
(logior! (-> v1-41 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-41 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(let ((v1-44 (-> self draw shadow-ctrl)))
|
||||
@@ -370,7 +370,7 @@
|
||||
(f26-0 (- (-> *standard-dynamics* gravity-length)))
|
||||
)
|
||||
(let ((v1-10 (-> self draw shadow-ctrl)))
|
||||
(logior! (-> v1-10 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-10 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(clear-collide-with-as (-> self root-override))
|
||||
@@ -429,7 +429,7 @@
|
||||
(initialize-skeleton self *keg-sg* '())
|
||||
(set! (-> self draw shadow-ctrl) (new 'process 'shadow-control 0.0 0.0 614400.0 (the-as float 60) 245760.0))
|
||||
(let ((v1-25 (-> self draw shadow-ctrl)))
|
||||
(logior! (-> v1-25 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-25 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(let ((s5-1 (new 'static 'vector :x -514715.0 :y 226968.0 :z 3906894.8 :w 1.0)))
|
||||
|
||||
@@ -883,7 +883,7 @@
|
||||
(collide-kind background)
|
||||
self
|
||||
t2-0
|
||||
1
|
||||
(new 'static 'pat-surface :noentity #x1)
|
||||
)
|
||||
0.0
|
||||
)
|
||||
|
||||
@@ -356,7 +356,7 @@
|
||||
(set! (-> a1-1 quad) (-> obj root trans quad))
|
||||
(set! (-> a1-1 y) (+ -8192.0 (-> a1-1 y)))
|
||||
(set-vector! a2-0 0.0 -81920.0 0.0 1.0)
|
||||
(when (>= (fill-and-probe-using-line-sphere *collide-cache* a1-1 a2-0 8192.0 (collide-kind background) pp s3-1 1)
|
||||
(when (>= (fill-and-probe-using-line-sphere *collide-cache* a1-1 a2-0 8192.0 (collide-kind background) pp s3-1 (new 'static 'pat-surface :noentity #x1))
|
||||
0.0
|
||||
)
|
||||
(set! (-> s3-1 intersect w) 8192.0)
|
||||
@@ -365,7 +365,7 @@
|
||||
)
|
||||
(set! s4-0 #t)
|
||||
(let ((v1-17 s5-0))
|
||||
(logclear! (-> v1-17 settings flags) (shadow-flags shdf05))
|
||||
(logclear! (-> v1-17 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(let ((v1-19 s5-0))
|
||||
@@ -403,7 +403,7 @@
|
||||
)
|
||||
)
|
||||
(when (not s4-0)
|
||||
(logior! (-> s5-0 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> s5-0 settings flags) (shadow-flags disable-draw))
|
||||
0
|
||||
(set! (-> obj draw bounds quad) (-> obj default-bounds quad))
|
||||
(set! (-> obj draw origin-joint-index) (the-as uint 4))
|
||||
@@ -836,7 +836,7 @@
|
||||
(logclear! (-> self mask) (process-mask actor-pause))
|
||||
(close-specific-task! (game-task plunger-lurker-hit) (task-status unknown))
|
||||
(while (and *target*
|
||||
(logtest? (-> *target* control unknown-surface00 flags) (surface-flags surf11))
|
||||
(logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump))
|
||||
(zero? (logand (-> *target* control status) (cshape-moving-flags onsurf)))
|
||||
)
|
||||
(suspend)
|
||||
@@ -1240,7 +1240,7 @@
|
||||
(new 'process 'shadow-control 131072.0 151552.0 614400.0 (the-as float 60) 409600.0)
|
||||
)
|
||||
(let ((v1-27 (-> obj draw shadow-ctrl)))
|
||||
(logclear! (-> v1-27 settings flags) (shadow-flags shdf05))
|
||||
(logclear! (-> v1-27 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(set! (-> obj alt-actor) (entity-actor-lookup arg0 'alt-actor 0))
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
|
||||
(define *ogreboss-missile-shadow-control*
|
||||
(new 'static 'shadow-control :settings (new 'static 'shadow-settings
|
||||
:center (new 'static 'vector :w (the-as float #xe))
|
||||
:flags (shadow-flags disable-fade shdf02 shdf03)
|
||||
:shadow-dir (new 'static 'vector :y -1.0 :w 614400.0)
|
||||
:bot-plane (new 'static 'plane :y 1.0 :w -102400.0)
|
||||
:top-plane (new 'static 'plane :y 1.0 :w -143360.0)
|
||||
@@ -60,7 +60,7 @@
|
||||
|
||||
(define *ogreboss-shadow-control*
|
||||
(new 'static 'shadow-control :settings (new 'static 'shadow-settings
|
||||
:center (new 'static 'vector :w (the-as float #xc))
|
||||
:flags (shadow-flags shdf02 shdf03)
|
||||
:shadow-dir (new 'static 'vector :y -1.0 :w 614400.0)
|
||||
:bot-plane (new 'static 'plane :y 1.0 :w -102400.0)
|
||||
:top-plane (new 'static 'plane :y 1.0 :w -143360.0)
|
||||
@@ -115,7 +115,7 @@
|
||||
(-> self root-override root-prim collide-with)
|
||||
(-> self parent-override 0)
|
||||
s4-0
|
||||
1
|
||||
(new 'static 'pat-surface :noentity #x1)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -164,7 +164,7 @@
|
||||
(-> self root-override root-prim collide-with)
|
||||
(-> self parent-override 0)
|
||||
s4-0
|
||||
1
|
||||
(new 'static 'pat-surface :noentity #x1)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -289,7 +289,7 @@
|
||||
(-> self root-override root-prim collide-with)
|
||||
t1-0
|
||||
t2-0
|
||||
1
|
||||
(new 'static 'pat-surface :noentity #x1)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
|
||||
(define *racer-shadow-control*
|
||||
(new 'static 'shadow-control :settings (new 'static 'shadow-settings
|
||||
:center (new 'static 'vector :w (the-as float #xa))
|
||||
:flags (shadow-flags disable-fade shdf03)
|
||||
:shadow-dir (new 'static 'vector :y -1.0 :w 614400.0)
|
||||
:bot-plane (new 'static 'plane :y 1.0 :w 81920.0)
|
||||
:top-plane (new 'static 'plane :y 1.0 :w 2048.0)
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
:alignv 1.0
|
||||
:slope-up-traction 1.0
|
||||
:align-speed 1.0
|
||||
:flags (surface-flags surf00)
|
||||
:flags (surface-flags allow-look-around)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
:slope-up-traction 1.0
|
||||
:align-speed 1.0
|
||||
:mode 'air
|
||||
:flags (surface-flags surf00 surf11)
|
||||
:flags (surface-flags allow-look-around jump)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@
|
||||
(collide-kind background)
|
||||
self
|
||||
t2-0
|
||||
1
|
||||
(new 'static 'pat-surface :noentity #x1)
|
||||
)
|
||||
)
|
||||
(v1-5 (new 'stack-no-clear 'vector))
|
||||
|
||||
@@ -720,7 +720,7 @@
|
||||
(collide-kind background)
|
||||
obj
|
||||
s3-1
|
||||
1
|
||||
(new 'static 'pat-surface :noentity #x1)
|
||||
)
|
||||
0.0
|
||||
)
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
|
||||
(define *snow-ball-shadow-control*
|
||||
(new 'static 'shadow-control :settings (new 'static 'shadow-settings
|
||||
:center (new 'static 'vector :w (the-as float #xa))
|
||||
:flags (shadow-flags disable-fade shdf03)
|
||||
:shadow-dir (new 'static 'vector :y -1.0 :w 245760.0)
|
||||
:bot-plane (new 'static 'plane :y 1.0 :w 26624.0)
|
||||
:top-plane (new 'static 'plane :y 1.0)
|
||||
|
||||
@@ -858,7 +858,7 @@
|
||||
:trans (behavior ()
|
||||
(when *target*
|
||||
(if (and (>= 798720.0 (-> (target-pos 0) y))
|
||||
(not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags surf11))
|
||||
(not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump))
|
||||
(zero? (logand (-> *target* control status) (cshape-moving-flags onsurf)))
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1177,7 +1177,7 @@
|
||||
(collide-kind background cak-2 ground-object)
|
||||
obj
|
||||
t2-0
|
||||
1
|
||||
(new 'static 'pat-surface :noentity #x1)
|
||||
)
|
||||
0.0
|
||||
)
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
|
||||
(define *bully-shadow-control*
|
||||
(new 'static 'shadow-control :settings (new 'static 'shadow-settings
|
||||
:center (new 'static 'vector :w (the-as float #x9))
|
||||
:flags (shadow-flags shdf00 shdf03)
|
||||
:shadow-dir (new 'static 'vector :y -1.0 :w 614400.0)
|
||||
:bot-plane (new 'static 'plane :y 1.0 :w 10240.0)
|
||||
:top-plane (new 'static 'plane :y 1.0 :w -2048.0)
|
||||
@@ -468,14 +468,14 @@
|
||||
(set! (-> self travel-speed) 0.0)
|
||||
(shut-down! (-> self neck))
|
||||
(let ((v1-5 (-> self draw shadow-ctrl)))
|
||||
(logior! (-> v1-5 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-5 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
:exit (behavior ()
|
||||
(let ((v1-1 (-> self draw shadow-ctrl)))
|
||||
(logclear! (-> v1-1 settings flags) (shadow-flags shdf05))
|
||||
(logclear! (-> v1-1 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(none)
|
||||
|
||||
@@ -308,7 +308,7 @@
|
||||
:code (behavior ((arg0 object) (arg1 vector) (arg2 vector))
|
||||
(dummy-51 self)
|
||||
(let ((v1-3 (-> self draw shadow-ctrl)))
|
||||
(logclear! (-> v1-3 settings flags) (shadow-flags shdf05))
|
||||
(logclear! (-> v1-3 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(logclear! (-> self collide-info nav-flags) (nav-flags navf0))
|
||||
@@ -497,7 +497,7 @@
|
||||
(ja :group! double-lurker-both-idle-ja :num! min)
|
||||
(transform-post)
|
||||
(let ((v1-13 (-> self draw shadow-ctrl)))
|
||||
(logior! (-> v1-13 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-13 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(go double-lurker-top-on-shoulders)
|
||||
@@ -929,7 +929,7 @@
|
||||
(collide-kind background)
|
||||
obj
|
||||
s4-0
|
||||
1
|
||||
(new 'static 'pat-surface :noentity #x1)
|
||||
)
|
||||
0.0
|
||||
)
|
||||
|
||||
@@ -167,12 +167,12 @@
|
||||
(collide-kind background cak-3 ground-object)
|
||||
obj
|
||||
s5-0
|
||||
1
|
||||
(new 'static 'pat-surface :noentity #x1)
|
||||
)
|
||||
0.0
|
||||
)
|
||||
(let ((v1-11 (-> obj draw shadow-ctrl)))
|
||||
(logclear! (-> v1-11 settings flags) (shadow-flags shdf05))
|
||||
(logclear! (-> v1-11 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(let ((v1-14 (-> obj draw shadow-ctrl)))
|
||||
@@ -186,7 +186,7 @@
|
||||
)
|
||||
(else
|
||||
(let ((v1-19 (-> obj draw shadow-ctrl)))
|
||||
(logior! (-> v1-19 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-19 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
)
|
||||
@@ -195,7 +195,7 @@
|
||||
)
|
||||
(else
|
||||
(let ((v1-21 (-> obj draw shadow-ctrl)))
|
||||
(logior! (-> v1-21 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-21 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
)
|
||||
@@ -570,7 +570,7 @@
|
||||
(set! (-> self attacking?) #f)
|
||||
(shut-down! (-> self neck))
|
||||
(let ((v1-5 (-> self draw shadow-ctrl)))
|
||||
(logior! (-> v1-5 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-5 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(none)
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
:slope-up-traction 1.0
|
||||
:align-speed 1.0
|
||||
:mode 'air
|
||||
:flags (surface-flags surf11)
|
||||
:flags (surface-flags jump)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
:alignv 1.0
|
||||
:slope-up-traction 1.0
|
||||
:align-speed 1.0
|
||||
:flags (surface-flags surf03 surf05)
|
||||
:flags (surface-flags no-turn-around always-rotate-toward-transv)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -735,7 +735,7 @@
|
||||
(collide-kind background cak-2 crate enemy wall-object projectile ground-object)
|
||||
self
|
||||
t2-0
|
||||
1
|
||||
(new 'static 'pat-surface :noentity #x1)
|
||||
)
|
||||
)
|
||||
(gp-1 (< f30-0 0.0))
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
)
|
||||
(when (!= (-> self index) 6)
|
||||
(while (and *target*
|
||||
(logtest? (-> *target* control unknown-surface00 flags) (surface-flags surf11))
|
||||
(logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump))
|
||||
(zero? (logand (-> *target* control status) (cshape-moving-flags onsurf)))
|
||||
)
|
||||
(suspend)
|
||||
@@ -694,7 +694,7 @@
|
||||
)
|
||||
(or (= (-> self type) scarecrow-a)
|
||||
(and (= (-> arg0 type) target)
|
||||
(logtest? (-> (the-as target arg0) control unknown-surface00 flags) (surface-flags surf11))
|
||||
(logtest? (-> (the-as target arg0) control unknown-surface00 flags) (surface-flags jump))
|
||||
(zero? (logand (-> (the-as target arg0) control status) (cshape-moving-flags onsurf)))
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
@@ -52,14 +53,14 @@
|
||||
(logtest? (-> obj draw status) (draw-status was-drawn))
|
||||
)
|
||||
(let ((v1-9 (-> obj draw shadow-ctrl)))
|
||||
(logclear! (-> v1-9 settings flags) (shadow-flags shdf05))
|
||||
(logclear! (-> v1-9 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(update-direction-from-time-of-day (-> obj draw shadow-ctrl))
|
||||
)
|
||||
(else
|
||||
(let ((v1-14 (-> obj draw shadow-ctrl)))
|
||||
(logior! (-> v1-14 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-14 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
)
|
||||
|
||||
@@ -51,14 +51,14 @@
|
||||
(logtest? (-> obj draw status) (draw-status was-drawn))
|
||||
)
|
||||
(let ((v1-9 (-> obj draw shadow-ctrl)))
|
||||
(logclear! (-> v1-9 settings flags) (shadow-flags shdf05))
|
||||
(logclear! (-> v1-9 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(update-direction-from-time-of-day (-> obj draw shadow-ctrl))
|
||||
)
|
||||
(else
|
||||
(let ((v1-14 (-> obj draw shadow-ctrl)))
|
||||
(logior! (-> v1-14 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-14 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
)
|
||||
|
||||
@@ -86,14 +86,14 @@
|
||||
(logtest? (-> obj draw status) (draw-status was-drawn))
|
||||
)
|
||||
(let ((v1-9 (-> obj draw shadow-ctrl)))
|
||||
(logclear! (-> v1-9 settings flags) (shadow-flags shdf05))
|
||||
(logclear! (-> v1-9 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(update-direction-from-time-of-day (-> obj draw shadow-ctrl))
|
||||
)
|
||||
(else
|
||||
(let ((v1-14 (-> obj draw shadow-ctrl)))
|
||||
(logior! (-> v1-14 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-14 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
)
|
||||
@@ -1207,7 +1207,7 @@
|
||||
(collide-kind target)
|
||||
(the-as process #f)
|
||||
t2-0
|
||||
1
|
||||
(new 'static 'pat-surface :noentity #x1)
|
||||
)
|
||||
0.0
|
||||
)
|
||||
|
||||
@@ -48,14 +48,14 @@
|
||||
(logtest? (-> obj draw status) (draw-status was-drawn))
|
||||
)
|
||||
(let ((v1-9 (-> obj draw shadow-ctrl)))
|
||||
(logclear! (-> v1-9 settings flags) (shadow-flags shdf05))
|
||||
(logclear! (-> v1-9 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(update-direction-from-time-of-day (-> obj draw shadow-ctrl))
|
||||
)
|
||||
(else
|
||||
(let ((v1-14 (-> obj draw shadow-ctrl)))
|
||||
(logior! (-> v1-14 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-14 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
)
|
||||
|
||||
@@ -48,14 +48,14 @@
|
||||
(logtest? (-> obj draw status) (draw-status was-drawn))
|
||||
)
|
||||
(let ((v1-9 (-> obj draw shadow-ctrl)))
|
||||
(logclear! (-> v1-9 settings flags) (shadow-flags shdf05))
|
||||
(logclear! (-> v1-9 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(update-direction-from-time-of-day (-> obj draw shadow-ctrl))
|
||||
)
|
||||
(else
|
||||
(let ((v1-14 (-> obj draw shadow-ctrl)))
|
||||
(logior! (-> v1-14 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-14 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
)
|
||||
|
||||
@@ -71,14 +71,14 @@
|
||||
(logtest? (-> obj draw status) (draw-status was-drawn))
|
||||
)
|
||||
(let ((v1-9 (-> obj draw shadow-ctrl)))
|
||||
(logclear! (-> v1-9 settings flags) (shadow-flags shdf05))
|
||||
(logclear! (-> v1-9 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(update-direction-from-time-of-day (-> obj draw shadow-ctrl))
|
||||
)
|
||||
(else
|
||||
(let ((v1-14 (-> obj draw shadow-ctrl)))
|
||||
(logior! (-> v1-14 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-14 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
)
|
||||
@@ -246,14 +246,14 @@
|
||||
(logtest? (-> obj draw status) (draw-status was-drawn))
|
||||
)
|
||||
(let ((v1-9 (-> obj draw shadow-ctrl)))
|
||||
(logclear! (-> v1-9 settings flags) (shadow-flags shdf05))
|
||||
(logclear! (-> v1-9 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(update-direction-from-time-of-day (-> obj draw shadow-ctrl))
|
||||
)
|
||||
(else
|
||||
(let ((v1-14 (-> obj draw shadow-ctrl)))
|
||||
(logior! (-> v1-14 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-14 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
)
|
||||
|
||||
@@ -290,13 +290,13 @@
|
||||
(logclear! (-> v1-1 settings flags) (shadow-flags shdf02))
|
||||
(set! (-> v1-1 settings bot-plane w) 20480.0)
|
||||
(let ((a0-8 v1-1))
|
||||
(logclear! (-> a0-8 settings flags) (shadow-flags shdf05))
|
||||
(logclear! (-> a0-8 settings flags) (shadow-flags disable-draw))
|
||||
)
|
||||
0
|
||||
(update-direction-from-time-of-day v1-1)
|
||||
)
|
||||
(else
|
||||
(logior! (-> v1-1 settings flags) (shadow-flags shdf05))
|
||||
(logior! (-> v1-1 settings flags) (shadow-flags disable-draw))
|
||||
0
|
||||
)
|
||||
)
|
||||
|
||||
@@ -210,7 +210,7 @@
|
||||
)
|
||||
)
|
||||
(when (and (< (vector-vector-xz-distance s5-1 (-> *target* control trans)) 18432.0)
|
||||
(and (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags surf11))
|
||||
(and (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump))
|
||||
(zero? (logand (-> *target* control status) (cshape-moving-flags onsurf)))
|
||||
)
|
||||
)
|
||||
|
||||
@@ -621,7 +621,7 @@
|
||||
)
|
||||
;; note: they appear to be calling this on the wrong object.
|
||||
;; this doesn't actually cause any problems but corrupts the type of `float` in the symbol
|
||||
;; table because they they write to some field of arg0, which is actually #t and not a
|
||||
;; table because they they write to some field of arg0, which is actually #t and not a
|
||||
;; basebutton. The corruption is completely harmless but is annoying because it looks like
|
||||
;; a more severe memory corruption problem. So we fix it.
|
||||
(the-as int ((the-as (function basebutton symbol none) (find-parent-method warp-gate-switch 31))
|
||||
@@ -952,7 +952,7 @@
|
||||
)
|
||||
)
|
||||
(while (and *target*
|
||||
(logtest? (-> *target* control unknown-surface00 flags) (surface-flags surf11))
|
||||
(logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump))
|
||||
(zero? (logand (-> *target* control status) (cshape-moving-flags onsurf)))
|
||||
)
|
||||
(suspend)
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@
|
||||
:flag-assert #xb000000c0
|
||||
(:methods
|
||||
(new (symbol type int) _type_ 0)
|
||||
(dummy-9 (_type_) float 9)
|
||||
(current-cycle-distance (_type_) float 9)
|
||||
(debug-print-channels (_type_ symbol) int 10)
|
||||
)
|
||||
)
|
||||
|
||||
+2
-2
@@ -1128,7 +1128,7 @@
|
||||
)
|
||||
|
||||
;; definition for method 9 of type cspace
|
||||
(defmethod dummy-9 cspace ((obj cspace) (arg0 basic))
|
||||
(defmethod reset-and-assign-geo! cspace ((obj cspace) (arg0 basic))
|
||||
(set! (-> obj parent) #f)
|
||||
(set! (-> obj joint) #f)
|
||||
(set! (-> obj geo) arg0)
|
||||
@@ -1144,7 +1144,7 @@
|
||||
(v1-1 type-to-make)
|
||||
)
|
||||
(-> type-to-make size)
|
||||
((method-of-type cspace dummy-9) (the-as cspace (t9-0 allocation v1-1)) arg0)
|
||||
((method-of-type cspace reset-and-assign-geo!) (the-as cspace (t9-0 allocation v1-1)) arg0)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
+1
-1
@@ -104,7 +104,7 @@
|
||||
:flag-assert #xa00000020
|
||||
(:methods
|
||||
(new (symbol type basic) _type_ 0)
|
||||
(dummy-9 (_type_ basic) _type_ 9)
|
||||
(reset-and-assign-geo! (_type_ basic) _type_ 9)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
+4
-4
@@ -75,7 +75,7 @@
|
||||
(set! (-> self head-offset) (-> *CAMERA_MASTER-bank* onscreen-head-height))
|
||||
(set! (-> self target-height) (-> *CAMERA_MASTER-bank* target-height))
|
||||
(set! (-> self on-ground)
|
||||
(not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags surf11))
|
||||
(not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump))
|
||||
(zero? (logand (-> *target* control status) (cshape-moving-flags onsurf)))
|
||||
)
|
||||
)
|
||||
@@ -403,7 +403,7 @@
|
||||
(collide-kind background)
|
||||
(the-as process #f)
|
||||
s4-2
|
||||
4098
|
||||
(new 'static 'pat-surface :nocamera #x1 :nolineofsight #x1)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -414,7 +414,7 @@
|
||||
)
|
||||
)
|
||||
(set! (-> self on-ground)
|
||||
(not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags surf11))
|
||||
(not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump))
|
||||
(zero? (logand (-> *target* control status) (cshape-moving-flags onsurf)))
|
||||
)
|
||||
)
|
||||
@@ -422,7 +422,7 @@
|
||||
(let ((gp-6 (new-stack-vector0)))
|
||||
0.0
|
||||
(cond
|
||||
((and (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags surf11))
|
||||
((and (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump))
|
||||
(zero? (logand (-> *target* control status) (cshape-moving-flags onsurf)))
|
||||
)
|
||||
(!= (-> *target* control unknown-surface00 name) 'launch-jump)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user