diff --git a/decompiler/IR2/FormExpressionAnalysis.cpp b/decompiler/IR2/FormExpressionAnalysis.cpp index 557376e5d8..ffed5d960e 100644 --- a/decompiler/IR2/FormExpressionAnalysis.cpp +++ b/decompiler/IR2/FormExpressionAnalysis.cpp @@ -4021,6 +4021,24 @@ std::vector cast_to_64_bit(const std::vector& 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( + 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{source_forms.at(0), nice_constant}); } - return pool.alloc_element(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( - 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( + GenericOperator::make_compare(IR2_Condition::Kind::FALSE), logtest_form); + return not_form; } - return nullptr; + */ + + return pool.alloc_element(GenericOperator::make_compare(m_kind), source_forms); } FormElement* try_make_logtest_cpad_macro(Form* in, FormPool& pool) { diff --git a/decompiler/config/all-types.gc b/decompiler/config/all-types.gc index 8edc5c5314..dacd70b6e7 100644 --- a/decompiler/config/all-types.gc +++ b/decompiler/config/all-types.gc @@ -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) diff --git a/game/mips2c/functions/collide_cache.cpp b/game/mips2c/functions/collide_cache.cpp index 6b27e26c77..67b8e604f5 100644 --- a/game/mips2c/functions/collide_cache.cpp +++ b/game/mips2c/functions/collide_cache.cpp @@ -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 diff --git a/goal_src/engine/anim/bones-h.gc b/goal_src/engine/anim/bones-h.gc index 56f2b059da..d0a6b7052c 100644 --- a/goal_src/engine/anim/bones-h.gc +++ b/goal_src/engine/anim/bones-h.gc @@ -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) diff --git a/goal_src/engine/anim/bones.gc b/goal_src/engine/anim/bones.gc index c59b4ec113..82f643ac99 100644 --- a/goal_src/engine/anim/bones.gc +++ b/goal_src/engine/anim/bones.gc @@ -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)) ) diff --git a/goal_src/engine/anim/joint-h.gc b/goal_src/engine/anim/joint-h.gc index 20e5035b10..0df4bbda56 100644 --- a/goal_src/engine/anim/joint-h.gc +++ b/goal_src/engine/anim/joint-h.gc @@ -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) ) ) diff --git a/goal_src/engine/anim/joint.gc b/goal_src/engine/anim/joint.gc index 4633058d1e..dc1503cd51 100644 --- a/goal_src/engine/anim/joint.gc +++ b/goal_src/engine/anim/joint.gc @@ -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) ; ) ; ) diff --git a/goal_src/engine/anim/mspace-h.gc b/goal_src/engine/anim/mspace-h.gc index 9cd473c6bd..c9251ee67e 100644 --- a/goal_src/engine/anim/mspace-h.gc +++ b/goal_src/engine/anim/mspace-h.gc @@ -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) ) ) diff --git a/goal_src/engine/camera/cam-debug.gc b/goal_src/engine/camera/cam-debug.gc index ba8a958372..91337a56e2 100644 --- a/goal_src/engine/camera/cam-debug.gc +++ b/goal_src/engine/camera/cam-debug.gc @@ -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)) diff --git a/goal_src/engine/camera/cam-master.gc b/goal_src/engine/camera/cam-master.gc index 601c696150..fea2700f41 100644 --- a/goal_src/engine/camera/cam-master.gc +++ b/goal_src/engine/camera/cam-master.gc @@ -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) diff --git a/goal_src/engine/camera/cam-states.gc b/goal_src/engine/camera/cam-states.gc index 23c3bee008..a92a8e3ad4 100644 --- a/goal_src/engine/camera/cam-states.gc +++ b/goal_src/engine/camera/cam-states.gc @@ -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 ) diff --git a/goal_src/engine/collide/collide-cache-h.gc b/goal_src/engine/collide/collide-cache-h.gc index f5c31b4f37..25cfb10174 100644 --- a/goal_src/engine/collide/collide-cache-h.gc +++ b/goal_src/engine/collide/collide-cache-h.gc @@ -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 diff --git a/goal_src/engine/collide/collide-cache.gc b/goal_src/engine/collide/collide-cache.gc index 443637cbb4..031c25d23a 100644 --- a/goal_src/engine/collide/collide-cache.gc +++ b/goal_src/engine/collide/collide-cache.gc @@ -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) ) ) diff --git a/goal_src/engine/collide/collide-edge-grab.gc b/goal_src/engine/collide/collide-edge-grab.gc index 91d09ea488..bb5c41ce80 100644 --- a/goal_src/engine/collide/collide-edge-grab.gc +++ b/goal_src/engine/collide/collide-edge-grab.gc @@ -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) diff --git a/goal_src/engine/collide/collide-reaction-target.gc b/goal_src/engine/collide/collide-reaction-target.gc index fb57073b6b..a0b39c3826 100644 --- a/goal_src/engine/collide/collide-reaction-target.gc +++ b/goal_src/engine/collide/collide-reaction-target.gc @@ -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))) diff --git a/goal_src/engine/collide/collide-shape.gc b/goal_src/engine/collide/collide-shape.gc index 78a90a8c1d..d69168d30a 100644 --- a/goal_src/engine/collide/collide-shape.gc +++ b/goal_src/engine/collide/collide-shape.gc @@ -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* diff --git a/goal_src/engine/data/art-h.gc b/goal_src/engine/data/art-h.gc index df43fb9817..7672d05b87 100644 --- a/goal_src/engine/data/art-h.gc +++ b/goal_src/engine/data/art-h.gc @@ -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 diff --git a/goal_src/engine/debug/memory-usage-h.gc b/goal_src/engine/debug/memory-usage-h.gc index e9c4cc7ec0..969f0fc0b8 100644 --- a/goal_src/engine/debug/memory-usage-h.gc +++ b/goal_src/engine/debug/memory-usage-h.gc @@ -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) diff --git a/goal_src/engine/draw/draw-node-h.gc b/goal_src/engine/draw/draw-node-h.gc index 7fef4ef929..e94ad51523 100644 --- a/goal_src/engine/draw/draw-node-h.gc +++ b/goal_src/engine/draw/draw-node-h.gc @@ -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? ) diff --git a/goal_src/engine/draw/drawable-ambient-h.gc b/goal_src/engine/draw/drawable-ambient-h.gc index b9c915d389..82c5333119 100644 --- a/goal_src/engine/draw/drawable-ambient-h.gc +++ b/goal_src/engine/draw/drawable-ambient-h.gc @@ -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 diff --git a/goal_src/engine/draw/drawable-h.gc b/goal_src/engine/draw/drawable-h.gc index c434710d67..97ed034a64 100644 --- a/goal_src/engine/draw/drawable-h.gc +++ b/goal_src/engine/draw/drawable-h.gc @@ -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) ) diff --git a/goal_src/engine/draw/drawable-inline-array-h.gc b/goal_src/engine/draw/drawable-inline-array-h.gc index f30a81257b..4a203a5d28 100644 --- a/goal_src/engine/draw/drawable-inline-array-h.gc +++ b/goal_src/engine/draw/drawable-inline-array-h.gc @@ -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) diff --git a/goal_src/engine/draw/process-drawable.gc b/goal_src/engine/draw/process-drawable.gc index 7d4fb713af..bc504a5235 100644 --- a/goal_src/engine/draw/process-drawable.gc +++ b/goal_src/engine/draw/process-drawable.gc @@ -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) diff --git a/goal_src/engine/game/game-info-h.gc b/goal_src/engine/game/game-info-h.gc index 084476ff20..52e1c21ba8 100644 --- a/goal_src/engine/game/game-info-h.gc +++ b/goal_src/engine/game/game-info-h.gc @@ -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) diff --git a/goal_src/engine/game/powerups.gc b/goal_src/engine/game/powerups.gc index b1d85ac8ac..96f264e8dc 100644 --- a/goal_src/engine/game/powerups.gc +++ b/goal_src/engine/game/powerups.gc @@ -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) diff --git a/goal_src/engine/game/task/hint-control-h.gc b/goal_src/engine/game/task/hint-control-h.gc index 17f595f963..725cdde68a 100644 --- a/goal_src/engine/game/task/hint-control-h.gc +++ b/goal_src/engine/game/task/hint-control-h.gc @@ -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) diff --git a/goal_src/engine/game/task/process-taskable.gc b/goal_src/engine/game/task/process-taskable.gc index df5b53eabf..ec7f10017d 100644 --- a/goal_src/engine/game/task/process-taskable.gc +++ b/goal_src/engine/game/task/process-taskable.gc @@ -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 ) diff --git a/goal_src/engine/gfx/generic/generic-h.gc b/goal_src/engine/gfx/generic/generic-h.gc index 33f533ab16..efb986982b 100644 --- a/goal_src/engine/gfx/generic/generic-h.gc +++ b/goal_src/engine/gfx/generic/generic-h.gc @@ -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? diff --git a/goal_src/engine/gfx/generic/generic-vu1-h.gc b/goal_src/engine/gfx/generic/generic-vu1-h.gc index ee79fc0b46..2226e74de6 100644 --- a/goal_src/engine/gfx/generic/generic-vu1-h.gc +++ b/goal_src/engine/gfx/generic/generic-vu1-h.gc @@ -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 diff --git a/goal_src/engine/gfx/generic/generic-work-h.gc b/goal_src/engine/gfx/generic/generic-work-h.gc index a4a4109a89..619366b20d 100644 --- a/goal_src/engine/gfx/generic/generic-work-h.gc +++ b/goal_src/engine/gfx/generic/generic-work-h.gc @@ -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) diff --git a/goal_src/engine/gfx/lights-h.gc b/goal_src/engine/gfx/lights-h.gc index c593ccf073..4cac1c0b3c 100644 --- a/goal_src/engine/gfx/lights-h.gc +++ b/goal_src/engine/gfx/lights-h.gc @@ -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) diff --git a/goal_src/engine/gfx/merc/generic-merc-h.gc b/goal_src/engine/gfx/merc/generic-merc-h.gc index a0a8c9f7cf..36126859de 100644 --- a/goal_src/engine/gfx/merc/generic-merc-h.gc +++ b/goal_src/engine/gfx/merc/generic-merc-h.gc @@ -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) diff --git a/goal_src/engine/gfx/merc/merc-h.gc b/goal_src/engine/gfx/merc/merc-h.gc index bbb98a7af3..6e59fcfe60 100644 --- a/goal_src/engine/gfx/merc/merc-h.gc +++ b/goal_src/engine/gfx/merc/merc-h.gc @@ -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 diff --git a/goal_src/engine/gfx/mood-h.gc b/goal_src/engine/gfx/mood-h.gc index 67491702c4..7284fafcf8 100644 --- a/goal_src/engine/gfx/mood-h.gc +++ b/goal_src/engine/gfx/mood-h.gc @@ -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) diff --git a/goal_src/engine/gfx/shadow/shadow-cpu-h.gc b/goal_src/engine/gfx/shadow/shadow-cpu-h.gc index 6a98a3893a..66c3879376 100644 --- a/goal_src/engine/gfx/shadow/shadow-cpu-h.gc +++ b/goal_src/engine/gfx/shadow/shadow-cpu-h.gc @@ -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) ) diff --git a/goal_src/engine/gfx/shadow/shadow-cpu.gc b/goal_src/engine/gfx/shadow/shadow-cpu.gc index 7a076be527..21b921fd1d 100644 --- a/goal_src/engine/gfx/shadow/shadow-cpu.gc +++ b/goal_src/engine/gfx/shadow/shadow-cpu.gc @@ -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 ) diff --git a/goal_src/engine/gfx/texture.gc b/goal_src/engine/gfx/texture.gc index 21b2213826..acab5a8189 100644 --- a/goal_src/engine/gfx/texture.gc +++ b/goal_src/engine/gfx/texture.gc @@ -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! diff --git a/goal_src/engine/gfx/tie/generic-tie-h.gc b/goal_src/engine/gfx/tie/generic-tie-h.gc index a1ae992681..7b132b63b2 100644 --- a/goal_src/engine/gfx/tie/generic-tie-h.gc +++ b/goal_src/engine/gfx/tie/generic-tie-h.gc @@ -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) diff --git a/goal_src/engine/gfx/tie/prototype-h.gc b/goal_src/engine/gfx/tie/prototype-h.gc index 0f82cf5a52..d0a210e652 100644 --- a/goal_src/engine/gfx/tie/prototype-h.gc +++ b/goal_src/engine/gfx/tie/prototype-h.gc @@ -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) diff --git a/goal_src/engine/gfx/wind-h.gc b/goal_src/engine/gfx/wind-h.gc index 51ad5d39e8..aa66bbc04b 100644 --- a/goal_src/engine/gfx/wind-h.gc +++ b/goal_src/engine/gfx/wind-h.gc @@ -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) diff --git a/goal_src/engine/target/logic-target.gc b/goal_src/engine/target/logic-target.gc index b0884e8362..8cfd1d06c7 100644 --- a/goal_src/engine/target/logic-target.gc +++ b/goal_src/engine/target/logic-target.gc @@ -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))) ) diff --git a/goal_src/engine/target/pat-h.gc b/goal_src/engine/target/pat-h.gc index 41fd516ac7..726264d848 100644 --- a/goal_src/engine/target/pat-h.gc +++ b/goal_src/engine/target/pat-h.gc @@ -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) diff --git a/goal_src/engine/target/surface-h.gc b/goal_src/engine/target/surface-h.gc index c364f5dae0..1f600eb1e1 100644 --- a/goal_src/engine/target/surface-h.gc +++ b/goal_src/engine/target/surface-h.gc @@ -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) ) ) ) diff --git a/goal_src/engine/target/target-death.gc b/goal_src/engine/target/target-death.gc index f8a74c4da9..530e182dfb 100644 --- a/goal_src/engine/target/target-death.gc +++ b/goal_src/engine/target/target-death.gc @@ -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 diff --git a/goal_src/engine/target/target-handler.gc b/goal_src/engine/target/target-handler.gc index 8eb9373ab2..40570cb271 100644 --- a/goal_src/engine/target/target-handler.gc +++ b/goal_src/engine/target/target-handler.gc @@ -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)) diff --git a/goal_src/engine/target/target-util.gc b/goal_src/engine/target/target-util.gc index 78da531f41..c2d266ab9d 100644 --- a/goal_src/engine/target/target-util.gc +++ b/goal_src/engine/target/target-util.gc @@ -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 ) diff --git a/goal_src/engine/target/target.gc b/goal_src/engine/target/target.gc index ad7e435084..e1e360683e 100644 --- a/goal_src/engine/target/target.gc +++ b/goal_src/engine/target/target.gc @@ -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) diff --git a/goal_src/engine/target/target2.gc b/goal_src/engine/target/target2.gc index d0a080b36d..e32018f661 100644 --- a/goal_src/engine/target/target2.gc +++ b/goal_src/engine/target/target2.gc @@ -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))) ) ) ) diff --git a/goal_src/levels/beach/bird-lady.gc b/goal_src/levels/beach/bird-lady.gc index a5af43088d..0435e3c041 100644 --- a/goal_src/levels/beach/bird-lady.gc +++ b/goal_src/levels/beach/bird-lady.gc @@ -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 ) diff --git a/goal_src/levels/beach/mayor.gc b/goal_src/levels/beach/mayor.gc index 813ec9b067..53d9039c0b 100644 --- a/goal_src/levels/beach/mayor.gc +++ b/goal_src/levels/beach/mayor.gc @@ -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)) diff --git a/goal_src/levels/beach/sculptor.gc b/goal_src/levels/beach/sculptor.gc index 069e6a459a..3195db4c61 100644 --- a/goal_src/levels/beach/sculptor.gc +++ b/goal_src/levels/beach/sculptor.gc @@ -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 ) diff --git a/goal_src/levels/beach/seagull.gc b/goal_src/levels/beach/seagull.gc index 2f61d15d70..7ab8db7467 100644 --- a/goal_src/levels/beach/seagull.gc +++ b/goal_src/levels/beach/seagull.gc @@ -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) ) ) ) diff --git a/goal_src/levels/citadel/citadel-sages.gc b/goal_src/levels/citadel/citadel-sages.gc index 82b0106c08..832f2f7e0f 100644 --- a/goal_src/levels/citadel/citadel-sages.gc +++ b/goal_src/levels/citadel/citadel-sages.gc @@ -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 ) diff --git a/goal_src/levels/common/basebutton.gc b/goal_src/levels/common/basebutton.gc index f165d349ae..054aa8fd65 100644 --- a/goal_src/levels/common/basebutton.gc +++ b/goal_src/levels/common/basebutton.gc @@ -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) ) ) diff --git a/goal_src/levels/common/joint-exploder.gc b/goal_src/levels/common/joint-exploder.gc index 8f90ddcbb6..722811e80e 100644 --- a/goal_src/levels/common/joint-exploder.gc +++ b/goal_src/levels/common/joint-exploder.gc @@ -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)) diff --git a/goal_src/levels/common/nav-enemy.gc b/goal_src/levels/common/nav-enemy.gc index 29babff80b..bbd99e6be9 100644 --- a/goal_src/levels/common/nav-enemy.gc +++ b/goal_src/levels/common/nav-enemy.gc @@ -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) diff --git a/goal_src/levels/common/plat-button.gc b/goal_src/levels/common/plat-button.gc index 461f69784e..8aaeb7faba 100644 --- a/goal_src/levels/common/plat-button.gc +++ b/goal_src/levels/common/plat-button.gc @@ -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))) ) ) diff --git a/goal_src/levels/finalboss/green-eco-lurker.gc b/goal_src/levels/finalboss/green-eco-lurker.gc index 93399470de..13178ee3c6 100644 --- a/goal_src/levels/finalboss/green-eco-lurker.gc +++ b/goal_src/levels/finalboss/green-eco-lurker.gc @@ -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))) diff --git a/goal_src/levels/finalboss/robotboss.gc b/goal_src/levels/finalboss/robotboss.gc index fcc465b634..ca63b8ecb1 100644 --- a/goal_src/levels/finalboss/robotboss.gc +++ b/goal_src/levels/finalboss/robotboss.gc @@ -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 ) diff --git a/goal_src/levels/flut_common/flutflut.gc b/goal_src/levels/flut_common/flutflut.gc index c17797e379..e36b0d8c45 100644 --- a/goal_src/levels/flut_common/flutflut.gc +++ b/goal_src/levels/flut_common/flutflut.gc @@ -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) diff --git a/goal_src/levels/flut_common/target-flut.gc b/goal_src/levels/flut_common/target-flut.gc index e4f49d5aae..9e2ee715db 100644 --- a/goal_src/levels/flut_common/target-flut.gc +++ b/goal_src/levels/flut_common/target-flut.gc @@ -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)) ) diff --git a/goal_src/levels/jungle/fisher.gc b/goal_src/levels/jungle/fisher.gc index e83f537b88..4fa7073bcf 100644 --- a/goal_src/levels/jungle/fisher.gc +++ b/goal_src/levels/jungle/fisher.gc @@ -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 ) diff --git a/goal_src/levels/jungle/jungle-mirrors.gc b/goal_src/levels/jungle/jungle-mirrors.gc index 3a4fa61c7b..4bd6eb95c3 100644 --- a/goal_src/levels/jungle/jungle-mirrors.gc +++ b/goal_src/levels/jungle/jungle-mirrors.gc @@ -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 ) diff --git a/goal_src/levels/jungleb/plant-boss.gc b/goal_src/levels/jungleb/plant-boss.gc index 79903cc20c..4b791ae3f5 100644 --- a/goal_src/levels/jungleb/plant-boss.gc +++ b/goal_src/levels/jungleb/plant-boss.gc @@ -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) diff --git a/goal_src/levels/maincave/dark-crystal.gc b/goal_src/levels/maincave/dark-crystal.gc index 15d0544704..48b3d484b7 100644 --- a/goal_src/levels/maincave/dark-crystal.gc +++ b/goal_src/levels/maincave/dark-crystal.gc @@ -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)) diff --git a/goal_src/levels/maincave/driller-lurker.gc b/goal_src/levels/maincave/driller-lurker.gc index a91b0c04e1..8933268e30 100644 --- a/goal_src/levels/maincave/driller-lurker.gc +++ b/goal_src/levels/maincave/driller-lurker.gc @@ -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) diff --git a/goal_src/levels/maincave/maincave-obs.gc b/goal_src/levels/maincave/maincave-obs.gc index 44a102281a..8865a5d7b9 100644 --- a/goal_src/levels/maincave/maincave-obs.gc +++ b/goal_src/levels/maincave/maincave-obs.gc @@ -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)) diff --git a/goal_src/levels/maincave/mother-spider-egg.gc b/goal_src/levels/maincave/mother-spider-egg.gc index 98dbfc560c..2be3e2892a 100644 --- a/goal_src/levels/maincave/mother-spider-egg.gc +++ b/goal_src/levels/maincave/mother-spider-egg.gc @@ -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)) diff --git a/goal_src/levels/maincave/mother-spider.gc b/goal_src/levels/maincave/mother-spider.gc index 744025ee7f..c46273b2e1 100644 --- a/goal_src/levels/maincave/mother-spider.gc +++ b/goal_src/levels/maincave/mother-spider.gc @@ -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 ) diff --git a/goal_src/levels/maincave/spiderwebs.gc b/goal_src/levels/maincave/spiderwebs.gc index c4d400cb15..df94bf6cb4 100644 --- a/goal_src/levels/maincave/spiderwebs.gc +++ b/goal_src/levels/maincave/spiderwebs.gc @@ -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) ) ) diff --git a/goal_src/levels/misty/misty-conveyor.gc b/goal_src/levels/misty/misty-conveyor.gc index 1c1128501c..0ffa93b57c 100644 --- a/goal_src/levels/misty/misty-conveyor.gc +++ b/goal_src/levels/misty/misty-conveyor.gc @@ -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))) diff --git a/goal_src/levels/misty/mistycannon.gc b/goal_src/levels/misty/mistycannon.gc index 3956f78e35..cfca405f56 100644 --- a/goal_src/levels/misty/mistycannon.gc +++ b/goal_src/levels/misty/mistycannon.gc @@ -883,7 +883,7 @@ (collide-kind background) self t2-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) diff --git a/goal_src/levels/ogre/flying-lurker.gc b/goal_src/levels/ogre/flying-lurker.gc index 68d567af17..48ed304a5e 100644 --- a/goal_src/levels/ogre/flying-lurker.gc +++ b/goal_src/levels/ogre/flying-lurker.gc @@ -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)) diff --git a/goal_src/levels/ogre/ogreboss.gc b/goal_src/levels/ogre/ogreboss.gc index 5b7a449c9b..fd8439eda1 100644 --- a/goal_src/levels/ogre/ogreboss.gc +++ b/goal_src/levels/ogre/ogreboss.gc @@ -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) ) ) ) diff --git a/goal_src/levels/racer_common/racer.gc b/goal_src/levels/racer_common/racer.gc index 72612f8106..893d4d01fd 100644 --- a/goal_src/levels/racer_common/racer.gc +++ b/goal_src/levels/racer_common/racer.gc @@ -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) diff --git a/goal_src/levels/racer_common/target-racer.gc b/goal_src/levels/racer_common/target-racer.gc index c35a5e9e4d..287e65206a 100644 --- a/goal_src/levels/racer_common/target-racer.gc +++ b/goal_src/levels/racer_common/target-racer.gc @@ -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) ) ) diff --git a/goal_src/levels/rolling/rolling-robber.gc b/goal_src/levels/rolling/rolling-robber.gc index d3fa46c4d5..80b5c40d63 100644 --- a/goal_src/levels/rolling/rolling-robber.gc +++ b/goal_src/levels/rolling/rolling-robber.gc @@ -156,7 +156,7 @@ (collide-kind background) self t2-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) ) (v1-5 (new 'stack-no-clear 'vector)) diff --git a/goal_src/levels/snow/ice-cube.gc b/goal_src/levels/snow/ice-cube.gc index 7ca2a2a878..0235a1c284 100644 --- a/goal_src/levels/snow/ice-cube.gc +++ b/goal_src/levels/snow/ice-cube.gc @@ -720,7 +720,7 @@ (collide-kind background) obj s3-1 - 1 + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) diff --git a/goal_src/levels/snow/snow-ball.gc b/goal_src/levels/snow/snow-ball.gc index a5552ba673..6df1995969 100644 --- a/goal_src/levels/snow/snow-ball.gc +++ b/goal_src/levels/snow/snow-ball.gc @@ -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) diff --git a/goal_src/levels/snow/snow-flutflut-obs.gc b/goal_src/levels/snow/snow-flutflut-obs.gc index ba4432a4e4..647bab97aa 100644 --- a/goal_src/levels/snow/snow-flutflut-obs.gc +++ b/goal_src/levels/snow/snow-flutflut-obs.gc @@ -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))) ) ) diff --git a/goal_src/levels/snow/snow-ram-boss.gc b/goal_src/levels/snow/snow-ram-boss.gc index f3ffb4027e..098b2a31c1 100644 --- a/goal_src/levels/snow/snow-ram-boss.gc +++ b/goal_src/levels/snow/snow-ram-boss.gc @@ -1177,7 +1177,7 @@ (collide-kind background cak-2 ground-object) obj t2-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) diff --git a/goal_src/levels/sunken/bully.gc b/goal_src/levels/sunken/bully.gc index 01221dccb6..c1ad7d8116 100644 --- a/goal_src/levels/sunken/bully.gc +++ b/goal_src/levels/sunken/bully.gc @@ -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) diff --git a/goal_src/levels/sunken/double-lurker.gc b/goal_src/levels/sunken/double-lurker.gc index 1bc2543780..f77186d49e 100644 --- a/goal_src/levels/sunken/double-lurker.gc +++ b/goal_src/levels/sunken/double-lurker.gc @@ -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 ) diff --git a/goal_src/levels/sunken/puffer.gc b/goal_src/levels/sunken/puffer.gc index 1d0d3d2ec4..c22dd437c5 100644 --- a/goal_src/levels/sunken/puffer.gc +++ b/goal_src/levels/sunken/puffer.gc @@ -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) diff --git a/goal_src/levels/sunken/target-tube.gc b/goal_src/levels/sunken/target-tube.gc index 847bcb7b4f..4f9368b91f 100644 --- a/goal_src/levels/sunken/target-tube.gc +++ b/goal_src/levels/sunken/target-tube.gc @@ -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) ) ) ) diff --git a/goal_src/levels/swamp/kermit.gc b/goal_src/levels/swamp/kermit.gc index 39cf2b0e6f..21af9ca458 100644 --- a/goal_src/levels/swamp/kermit.gc +++ b/goal_src/levels/swamp/kermit.gc @@ -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)) diff --git a/goal_src/levels/training/training-obs.gc b/goal_src/levels/training/training-obs.gc index dae9b03d5b..2819c7fe92 100644 --- a/goal_src/levels/training/training-obs.gc +++ b/goal_src/levels/training/training-obs.gc @@ -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))) ) ) diff --git a/goal_src/levels/village1/assistant.gc b/goal_src/levels/village1/assistant.gc index eff090cb0f..ce73e014f6 100644 --- a/goal_src/levels/village1/assistant.gc +++ b/goal_src/levels/village1/assistant.gc @@ -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 ) diff --git a/goal_src/levels/village1/explorer.gc b/goal_src/levels/village1/explorer.gc index 9dd1cd03b9..2923dc38b2 100644 --- a/goal_src/levels/village1/explorer.gc +++ b/goal_src/levels/village1/explorer.gc @@ -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 ) diff --git a/goal_src/levels/village2/assistant-village2.gc b/goal_src/levels/village2/assistant-village2.gc index 1d513bc29f..34d23f530a 100644 --- a/goal_src/levels/village2/assistant-village2.gc +++ b/goal_src/levels/village2/assistant-village2.gc @@ -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 ) diff --git a/goal_src/levels/village2/warrior.gc b/goal_src/levels/village2/warrior.gc index bbe699f7a0..eaf7da09b0 100644 --- a/goal_src/levels/village2/warrior.gc +++ b/goal_src/levels/village2/warrior.gc @@ -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 ) diff --git a/goal_src/levels/village3/assistant-village3.gc b/goal_src/levels/village3/assistant-village3.gc index 3cecc740d2..632c4d7a12 100644 --- a/goal_src/levels/village3/assistant-village3.gc +++ b/goal_src/levels/village3/assistant-village3.gc @@ -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 ) diff --git a/goal_src/levels/village3/miners.gc b/goal_src/levels/village3/miners.gc index c67725f760..49718bb9ce 100644 --- a/goal_src/levels/village3/miners.gc +++ b/goal_src/levels/village3/miners.gc @@ -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 ) diff --git a/goal_src/levels/village3/sage-village3.gc b/goal_src/levels/village3/sage-village3.gc index 9369b45e4c..6f0b290c2d 100644 --- a/goal_src/levels/village3/sage-village3.gc +++ b/goal_src/levels/village3/sage-village3.gc @@ -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 ) ) diff --git a/goal_src/levels/village3/village3-obs.gc b/goal_src/levels/village3/village3-obs.gc index b7458be5d0..197c95392c 100644 --- a/goal_src/levels/village3/village3-obs.gc +++ b/goal_src/levels/village3/village3-obs.gc @@ -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))) ) ) diff --git a/goal_src/levels/village_common/villagep-obs.gc b/goal_src/levels/village_common/villagep-obs.gc index 89cec6d5d5..96fe13ad74 100644 --- a/goal_src/levels/village_common/villagep-obs.gc +++ b/goal_src/levels/village_common/villagep-obs.gc @@ -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) diff --git a/test/decompiler/reference/engine/anim/joint-h_REF.gc b/test/decompiler/reference/engine/anim/joint-h_REF.gc index e6cc0e14de..071f9904ca 100644 --- a/test/decompiler/reference/engine/anim/joint-h_REF.gc +++ b/test/decompiler/reference/engine/anim/joint-h_REF.gc @@ -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) ) ) diff --git a/test/decompiler/reference/engine/anim/joint_REF.gc b/test/decompiler/reference/engine/anim/joint_REF.gc index 4443a9e246..adbd4af362 100644 --- a/test/decompiler/reference/engine/anim/joint_REF.gc +++ b/test/decompiler/reference/engine/anim/joint_REF.gc @@ -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) ) ) diff --git a/test/decompiler/reference/engine/anim/mspace-h_REF.gc b/test/decompiler/reference/engine/anim/mspace-h_REF.gc index e2df620ae8..4131ebd75b 100644 --- a/test/decompiler/reference/engine/anim/mspace-h_REF.gc +++ b/test/decompiler/reference/engine/anim/mspace-h_REF.gc @@ -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) ) ) diff --git a/test/decompiler/reference/engine/camera/cam-master_REF.gc b/test/decompiler/reference/engine/camera/cam-master_REF.gc index 13c54135f3..15c02f8b16 100644 --- a/test/decompiler/reference/engine/camera/cam-master_REF.gc +++ b/test/decompiler/reference/engine/camera/cam-master_REF.gc @@ -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) diff --git a/test/decompiler/reference/engine/camera/cam-states_REF.gc b/test/decompiler/reference/engine/camera/cam-states_REF.gc index 4eab519e52..738a948eaf 100644 --- a/test/decompiler/reference/engine/camera/cam-states_REF.gc +++ b/test/decompiler/reference/engine/camera/cam-states_REF.gc @@ -1284,7 +1284,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 ) @@ -1646,7 +1646,7 @@ ) ;; definition for function cam-los-spline-collide -(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) @@ -1660,7 +1660,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 @@ -1866,7 +1866,7 @@ ;; WARN: Unsupported inline assembly instruction kind - [madda.s f3, f6] ;; WARN: Unsupported inline assembly instruction kind - [madd.s f2, f4, f7] ;; Used lq/sq -(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))) @@ -2019,7 +2019,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 :nocamera #x1 :nolineofsight #x1) ) ) ) @@ -2052,7 +2052,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 :nocamera #x1 :nolineofsight #x1) ) ) (< f30-1 0.0) @@ -2322,7 +2322,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 :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))) @@ -2556,7 +2556,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 ) @@ -2661,7 +2661,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 ) @@ -2964,7 +2964,7 @@ (collide-kind background cak-3 wall-object ground-object cak-14) (the-as process #f) s4-0 - 4098 + (new 'static 'pat-surface :nocamera #x1 :nolineofsight #x1) ) ) ) @@ -3110,7 +3110,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 ) @@ -3389,7 +3389,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 ) diff --git a/test/decompiler/reference/engine/collide/collide-cache-h_REF.gc b/test/decompiler/reference/engine/collide/collide-cache-h_REF.gc index 1829745414..acc608f5fe 100644 --- a/test/decompiler/reference/engine/collide/collide-cache-h_REF.gc +++ b/test/decompiler/reference/engine/collide/collide-cache-h_REF.gc @@ -7,7 +7,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 @@ -183,15 +183,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) diff --git a/test/decompiler/reference/engine/collide/collide-edge-grab_REF.gc b/test/decompiler/reference/engine/collide/collide-edge-grab_REF.gc index e343014076..35773a7119 100644 --- a/test/decompiler/reference/engine/collide/collide-edge-grab_REF.gc +++ b/test/decompiler/reference/engine/collide/collide-edge-grab_REF.gc @@ -187,7 +187,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) @@ -325,7 +325,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) @@ -333,7 +333,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 :delay (empty-form)) @@ -759,7 +759,7 @@ :alignv 1.0 :slope-up-traction 1.0 :align-speed 1.0 - :flags (surface-flags surf14) + :flags (surface-flags moving-ground) ) ) ) @@ -799,7 +799,7 @@ :alignv 0.5 :slope-up-traction 0.9 :align-speed 1.0 - :flags (surface-flags surf03 surf05) + :flags (surface-flags no-turn-around always-rotate-toward-transv) ) ) ) diff --git a/test/decompiler/reference/engine/collide/collide-reaction-target_REF.gc b/test/decompiler/reference/engine/collide/collide-reaction-target_REF.gc index 76c8057577..a0484b74ee 100644 --- a/test/decompiler/reference/engine/collide/collide-reaction-target_REF.gc +++ b/test/decompiler/reference/engine/collide/collide-reaction-target_REF.gc @@ -115,7 +115,15 @@ (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) @@ -138,7 +146,15 @@ (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))) @@ -247,7 +263,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))) diff --git a/test/decompiler/reference/engine/draw/process-drawable_REF.gc b/test/decompiler/reference/engine/draw/process-drawable_REF.gc index 084e62af78..9ddfad7d54 100644 --- a/test/decompiler/reference/engine/draw/process-drawable_REF.gc +++ b/test/decompiler/reference/engine/draw/process-drawable_REF.gc @@ -167,7 +167,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!) @@ -176,13 +176,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))) @@ -200,7 +200,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)) @@ -1006,7 +1006,7 @@ ) ;; definition for method 9 of type joint-control -(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))) @@ -1085,7 +1085,7 @@ ;; definition for function process-drawable-delay-player (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) diff --git a/test/decompiler/reference/engine/game/powerups_REF.gc b/test/decompiler/reference/engine/game/powerups_REF.gc index 7733c34394..d8fa31d00a 100644 --- a/test/decompiler/reference/engine/game/powerups_REF.gc +++ b/test/decompiler/reference/engine/game/powerups_REF.gc @@ -754,7 +754,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) diff --git a/test/decompiler/reference/engine/game/task/process-taskable_REF.gc b/test/decompiler/reference/engine/game/task/process-taskable_REF.gc index de85b7022c..d21a0dff12 100644 --- a/test/decompiler/reference/engine/game/task/process-taskable_REF.gc +++ b/test/decompiler/reference/engine/game/task/process-taskable_REF.gc @@ -691,7 +691,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) @@ -713,7 +713,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 ) @@ -951,7 +951,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))) ) ) @@ -1354,7 +1354,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 ) diff --git a/test/decompiler/reference/engine/target/logic-target_REF.gc b/test/decompiler/reference/engine/target/logic-target_REF.gc index f971de318b..138a92bc03 100644 --- a/test/decompiler/reference/engine/target/logic-target_REF.gc +++ b/test/decompiler/reference/engine/target/logic-target_REF.gc @@ -19,7 +19,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) ) @@ -568,7 +568,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)) @@ -783,7 +783,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) @@ -802,7 +802,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) ) @@ -932,10 +932,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) @@ -1062,7 +1062,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) @@ -1123,7 +1123,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))) ) diff --git a/test/decompiler/reference/engine/target/surface-h_REF.gc b/test/decompiler/reference/engine/target/surface-h_REF.gc index 57846c1775..85765ddc03 100644 --- a/test/decompiler/reference/engine/target/surface-h_REF.gc +++ b/test/decompiler/reference/engine/target/surface-h_REF.gc @@ -200,7 +200,7 @@ :alignv 1.0 :slope-up-traction 1.0 :align-speed 1.0 - :flags (surface-flags surf00) + :flags (surface-flags allow-look-around) ) ) @@ -278,7 +278,7 @@ :alignv 1.0 :slope-up-traction 1.0 :align-speed 1.0 - :flags (surface-flags surf13) + :flags (surface-flags ducking) ) ) ) @@ -310,7 +310,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'attack - :flags (surface-flags surf12 surf13) + :flags (surface-flags attacking ducking) ) ) @@ -340,7 +340,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags (surface-flags surf10 surf11) + :flags (surface-flags allow-edge-grab jump) ) ) @@ -370,7 +370,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags (surface-flags surf10 surf11) + :flags (surface-flags allow-edge-grab jump) ) ) @@ -400,7 +400,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags (surface-flags surf10 surf11) + :flags (surface-flags allow-edge-grab jump) ) ) @@ -430,7 +430,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags (surface-flags surf10 surf11) + :flags (surface-flags allow-edge-grab jump) ) ) @@ -460,7 +460,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) ) ) @@ -490,7 +490,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags (surface-flags surf10 surf11) + :flags (surface-flags allow-edge-grab jump) ) ) @@ -520,7 +520,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags (surface-flags surf10 surf11) + :flags (surface-flags allow-edge-grab jump) ) ) @@ -550,7 +550,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags (surface-flags surf10 surf11) + :flags (surface-flags allow-edge-grab jump) ) ) @@ -580,7 +580,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags (surface-flags surf10 surf11) + :flags (surface-flags allow-edge-grab jump) ) ) @@ -608,7 +608,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'attack - :flags (surface-flags surf12) + :flags (surface-flags attacking) ) ) @@ -637,7 +637,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) ) ) @@ -666,7 +666,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 +695,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) ) ) @@ -723,7 +723,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'attack - :flags (surface-flags surf12) + :flags (surface-flags attacking) ) ) @@ -748,7 +748,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) ) ) @@ -774,7 +774,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'attack - :flags (surface-flags surf11 surf12) + :flags (surface-flags jump attacking) ) ) @@ -804,7 +804,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags (surface-flags surf11) + :flags (surface-flags jump) ) ) ) @@ -838,7 +838,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'wade - :flags (surface-flags surf00) + :flags (surface-flags allow-look-around) ) ) @@ -891,7 +891,7 @@ :alignv 1.0 :align-speed 1.0 :mode 'dive - :flags (surface-flags surf01) + :flags (surface-flags dive) ) ) @@ -921,7 +921,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'dive - :flags (surface-flags surf01) + :flags (surface-flags dive) ) ) @@ -1211,7 +1211,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) ) ) ) diff --git a/test/decompiler/reference/engine/target/target-death_REF.gc b/test/decompiler/reference/engine/target/target-death_REF.gc index 93adfbfe34..238d1c4a98 100644 --- a/test/decompiler/reference/engine/target/target-death_REF.gc +++ b/test/decompiler/reference/engine/target/target-death_REF.gc @@ -496,7 +496,7 @@ (none) ) :mode 'air - :flags (surface-flags surf11) + :flags (surface-flags jump) ) ) @@ -542,7 +542,7 @@ (none) ) :mode 'air - :flags (surface-flags surf03 surf04 surf11) + :flags (surface-flags no-turn-around no-rotate-toward-transv jump) ) ) @@ -628,7 +628,8 @@ (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 diff --git a/test/decompiler/reference/engine/target/target-handler_REF.gc b/test/decompiler/reference/engine/target/target-handler_REF.gc index d75ff792f4..4b429897cc 100644 --- a/test/decompiler/reference/engine/target/target-handler_REF.gc +++ b/test/decompiler/reference/engine/target/target-handler_REF.gc @@ -225,13 +225,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 ) @@ -827,7 +827,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)) diff --git a/test/decompiler/reference/engine/target/target-util_REF.gc b/test/decompiler/reference/engine/target/target-util_REF.gc index 6c218a3bae..2ef06d068c 100644 --- a/test/decompiler/reference/engine/target/target-util_REF.gc +++ b/test/decompiler/reference/engine/target/target-util_REF.gc @@ -16,7 +16,7 @@ ;; definition for symbol *target-shadow-control*, type shadow-control (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) @@ -834,7 +834,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) @@ -875,7 +875,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)) @@ -949,7 +949,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 @@ -973,7 +973,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 @@ -1007,7 +1007,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 ) diff --git a/test/decompiler/reference/engine/target/target2_REF.gc b/test/decompiler/reference/engine/target/target2_REF.gc index 36d8d19b44..4c42b0f9fe 100644 --- a/test/decompiler/reference/engine/target/target2_REF.gc +++ b/test/decompiler/reference/engine/target/target2_REF.gc @@ -1211,7 +1211,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) @@ -1347,7 +1347,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)) ) ) @@ -1507,7 +1507,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags (surface-flags surf11) + :flags (surface-flags jump) ) ) @@ -1922,7 +1922,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))) ) ) ) diff --git a/test/decompiler/reference/engine/target/target_REF.gc b/test/decompiler/reference/engine/target/target_REF.gc index 8451f11a76..b0523c8fc5 100644 --- a/test/decompiler/reference/engine/target/target_REF.gc +++ b/test/decompiler/reference/engine/target/target_REF.gc @@ -931,7 +931,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)) @@ -1073,7 +1073,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)) @@ -1472,7 +1472,8 @@ (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 +1595,8 @@ (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 @@ -1694,7 +1696,8 @@ (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 @@ -2163,7 +2166,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 @@ -2551,7 +2554,8 @@ (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)) @@ -2895,7 +2899,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) ) @@ -2926,7 +2930,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) diff --git a/test/decompiler/reference/levels/beach/bird-lady_REF.gc b/test/decompiler/reference/levels/beach/bird-lady_REF.gc index 54600e1611..552df8f6aa 100644 --- a/test/decompiler/reference/levels/beach/bird-lady_REF.gc +++ b/test/decompiler/reference/levels/beach/bird-lady_REF.gc @@ -57,14 +57,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 ) diff --git a/test/decompiler/reference/levels/beach/mayor_REF.gc b/test/decompiler/reference/levels/beach/mayor_REF.gc index 6a7deb6880..d3729fdfee 100644 --- a/test/decompiler/reference/levels/beach/mayor_REF.gc +++ b/test/decompiler/reference/levels/beach/mayor_REF.gc @@ -54,7 +54,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)) diff --git a/test/decompiler/reference/levels/beach/sculptor_REF.gc b/test/decompiler/reference/levels/beach/sculptor_REF.gc index c8cfac8970..5b0c5f59d6 100644 --- a/test/decompiler/reference/levels/beach/sculptor_REF.gc +++ b/test/decompiler/reference/levels/beach/sculptor_REF.gc @@ -63,14 +63,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 ) diff --git a/test/decompiler/reference/levels/beach/seagull_REF.gc b/test/decompiler/reference/levels/beach/seagull_REF.gc index fcfb43ff71..530ee24b4d 100644 --- a/test/decompiler/reference/levels/beach/seagull_REF.gc +++ b/test/decompiler/reference/levels/beach/seagull_REF.gc @@ -1047,7 +1047,7 @@ (collide-kind background) self s5-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) ) ) diff --git a/test/decompiler/reference/levels/citadel/citadel-sages_REF.gc b/test/decompiler/reference/levels/citadel/citadel-sages_REF.gc index 6ea2ce3a42..43dd2732a1 100644 --- a/test/decompiler/reference/levels/citadel/citadel-sages_REF.gc +++ b/test/decompiler/reference/levels/citadel/citadel-sages_REF.gc @@ -560,14 +560,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 ) @@ -690,14 +690,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 ) @@ -825,14 +825,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 ) diff --git a/test/decompiler/reference/levels/common/basebutton_REF.gc b/test/decompiler/reference/levels/common/basebutton_REF.gc index 221af70025..1ab2cad684 100644 --- a/test/decompiler/reference/levels/common/basebutton_REF.gc +++ b/test/decompiler/reference/levels/common/basebutton_REF.gc @@ -590,7 +590,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags (surface-flags surf05) + :flags (surface-flags always-rotate-toward-transv) ) ) diff --git a/test/decompiler/reference/levels/common/joint-exploder_REF.gc b/test/decompiler/reference/levels/common/joint-exploder_REF.gc index 39f442d0d6..11d7c05930 100644 --- a/test/decompiler/reference/levels/common/joint-exploder_REF.gc +++ b/test/decompiler/reference/levels/common/joint-exploder_REF.gc @@ -517,7 +517,15 @@ (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)) diff --git a/test/decompiler/reference/levels/common/nav-enemy_REF.gc b/test/decompiler/reference/levels/common/nav-enemy_REF.gc index 2c9b284a3c..546f426665 100644 --- a/test/decompiler/reference/levels/common/nav-enemy_REF.gc +++ b/test/decompiler/reference/levels/common/nav-enemy_REF.gc @@ -1825,7 +1825,7 @@ nav-enemy-default-event-handler ;; definition for symbol *nav-enemy-dummy-shadow-control*, type shadow-control (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) diff --git a/test/decompiler/reference/levels/common/plat-button_REF.gc b/test/decompiler/reference/levels/common/plat-button_REF.gc index 471539f5ef..637e83e88a 100644 --- a/test/decompiler/reference/levels/common/plat-button_REF.gc +++ b/test/decompiler/reference/levels/common/plat-button_REF.gc @@ -220,7 +220,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))) ) ) @@ -295,7 +295,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))) ) ) diff --git a/test/decompiler/reference/levels/finalboss/green-eco-lurker_REF.gc b/test/decompiler/reference/levels/finalboss/green-eco-lurker_REF.gc index 703cf903ea..0ab2b4ccf9 100644 --- a/test/decompiler/reference/levels/finalboss/green-eco-lurker_REF.gc +++ b/test/decompiler/reference/levels/finalboss/green-eco-lurker_REF.gc @@ -473,7 +473,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)) @@ -486,7 +486,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 ) @@ -623,7 +623,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)) @@ -726,7 +726,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))) diff --git a/test/decompiler/reference/levels/finalboss/robotboss_REF.gc b/test/decompiler/reference/levels/finalboss/robotboss_REF.gc index 8fcc22a366..08f0b7447c 100644 --- a/test/decompiler/reference/levels/finalboss/robotboss_REF.gc +++ b/test/decompiler/reference/levels/finalboss/robotboss_REF.gc @@ -48,7 +48,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) @@ -2420,7 +2420,7 @@ (collide-kind target) self t2-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) diff --git a/test/decompiler/reference/levels/flut_common/flutflut_REF.gc b/test/decompiler/reference/levels/flut_common/flutflut_REF.gc index 287cab2953..f8bf862176 100644 --- a/test/decompiler/reference/levels/flut_common/flutflut_REF.gc +++ b/test/decompiler/reference/levels/flut_common/flutflut_REF.gc @@ -64,7 +64,7 @@ ;; definition for symbol *flutflut-shadow-control*, type shadow-control (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) diff --git a/test/decompiler/reference/levels/flut_common/target-flut_REF.gc b/test/decompiler/reference/levels/flut_common/target-flut_REF.gc index 822af88926..990b0a4dd3 100644 --- a/test/decompiler/reference/levels/flut_common/target-flut_REF.gc +++ b/test/decompiler/reference/levels/flut_common/target-flut_REF.gc @@ -89,7 +89,7 @@ :alignv 1.0 :slope-up-traction 1.0 :align-speed 1.0 - :flags (surface-flags surf03) + :flags (surface-flags no-turn-around) ) ) @@ -119,7 +119,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags (surface-flags surf11) + :flags (surface-flags jump) ) ) @@ -149,7 +149,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags (surface-flags surf11) + :flags (surface-flags jump) ) ) @@ -174,7 +174,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) ) ) @@ -200,7 +200,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'attack - :flags (surface-flags surf11 surf12) + :flags (surface-flags jump attacking) ) ) @@ -767,7 +767,7 @@ (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))) ) (if (= (-> self control surf name) '*tar-surface*) @@ -873,7 +873,8 @@ (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)) @@ -987,7 +988,8 @@ (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)) ) diff --git a/test/decompiler/reference/levels/jungle/fisher_REF.gc b/test/decompiler/reference/levels/jungle/fisher_REF.gc index 686210cf38..d59e62fe6b 100644 --- a/test/decompiler/reference/levels/jungle/fisher_REF.gc +++ b/test/decompiler/reference/levels/jungle/fisher_REF.gc @@ -911,14 +911,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 ) diff --git a/test/decompiler/reference/levels/jungle/jungle-mirrors_REF.gc b/test/decompiler/reference/levels/jungle/jungle-mirrors_REF.gc index 1ae14b0c0f..ecdd2196bb 100644 --- a/test/decompiler/reference/levels/jungle/jungle-mirrors_REF.gc +++ b/test/decompiler/reference/levels/jungle/jungle-mirrors_REF.gc @@ -1416,7 +1416,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))) ) ) @@ -2168,7 +2168,7 @@ (collide-kind target) (the-as process #f) t2-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) diff --git a/test/decompiler/reference/levels/jungleb/plant-boss_REF.gc b/test/decompiler/reference/levels/jungleb/plant-boss_REF.gc index 47f4eac8c0..6d70b8e69c 100644 --- a/test/decompiler/reference/levels/jungleb/plant-boss_REF.gc +++ b/test/decompiler/reference/levels/jungleb/plant-boss_REF.gc @@ -205,7 +205,7 @@ ;; definition for symbol *plant-boss-shadow-control*, type shadow-control (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) diff --git a/test/decompiler/reference/levels/maincave/dark-crystal_REF.gc b/test/decompiler/reference/levels/maincave/dark-crystal_REF.gc index d31d299942..ca841bb66b 100644 --- a/test/decompiler/reference/levels/maincave/dark-crystal_REF.gc +++ b/test/decompiler/reference/levels/maincave/dark-crystal_REF.gc @@ -611,7 +611,16 @@ (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)) diff --git a/test/decompiler/reference/levels/maincave/driller-lurker_REF.gc b/test/decompiler/reference/levels/maincave/driller-lurker_REF.gc index 81266e4192..844c8671a6 100644 --- a/test/decompiler/reference/levels/maincave/driller-lurker_REF.gc +++ b/test/decompiler/reference/levels/maincave/driller-lurker_REF.gc @@ -103,7 +103,7 @@ ;; definition for symbol *driller-lurker-shadow-control*, type shadow-control (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) diff --git a/test/decompiler/reference/levels/maincave/maincave-obs_REF.gc b/test/decompiler/reference/levels/maincave/maincave-obs_REF.gc index 65d314970d..d6b6fd836d 100644 --- a/test/decompiler/reference/levels/maincave/maincave-obs_REF.gc +++ b/test/decompiler/reference/levels/maincave/maincave-obs_REF.gc @@ -317,7 +317,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))) ) ) @@ -334,7 +334,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)) diff --git a/test/decompiler/reference/levels/maincave/mother-spider-egg_REF.gc b/test/decompiler/reference/levels/maincave/mother-spider-egg_REF.gc index bbb9b630a2..0c26edc92b 100644 --- a/test/decompiler/reference/levels/maincave/mother-spider-egg_REF.gc +++ b/test/decompiler/reference/levels/maincave/mother-spider-egg_REF.gc @@ -195,11 +195,20 @@ (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))) @@ -214,7 +223,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 ) @@ -223,7 +232,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 ) @@ -392,7 +401,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) @@ -406,7 +415,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)) @@ -449,7 +458,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 @@ -482,7 +491,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)) diff --git a/test/decompiler/reference/levels/maincave/mother-spider_REF.gc b/test/decompiler/reference/levels/maincave/mother-spider_REF.gc index a23ea985f7..cb2e45dabb 100644 --- a/test/decompiler/reference/levels/maincave/mother-spider_REF.gc +++ b/test/decompiler/reference/levels/maincave/mother-spider_REF.gc @@ -108,7 +108,7 @@ (collide-kind background) self gp-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) @@ -368,7 +368,7 @@ ;; definition for method 31 of type mother-spider (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))) ) ) @@ -415,11 +415,20 @@ (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))) @@ -440,7 +449,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 ) @@ -449,7 +458,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 ) @@ -724,7 +733,7 @@ (collide-kind background) obj (the-as collide-tri-result s5-1) - 1 + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) @@ -826,7 +835,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)) @@ -1061,7 +1070,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))) ) ) @@ -1444,7 +1453,7 @@ (collide-kind background) obj s2-2 - 1 + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) @@ -1478,7 +1487,7 @@ (collide-kind background) obj s3-2 - 1 + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) diff --git a/test/decompiler/reference/levels/maincave/spiderwebs_REF.gc b/test/decompiler/reference/levels/maincave/spiderwebs_REF.gc index 77672db819..2a76339467 100644 --- a/test/decompiler/reference/levels/maincave/spiderwebs_REF.gc +++ b/test/decompiler/reference/levels/maincave/spiderwebs_REF.gc @@ -29,7 +29,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags (surface-flags surf10 surf11) + :flags (surface-flags allow-edge-grab jump) ) ) diff --git a/test/decompiler/reference/levels/misty/misty-conveyor_REF.gc b/test/decompiler/reference/levels/misty/misty-conveyor_REF.gc index 60fa43ba3d..07dd3f5dba 100644 --- a/test/decompiler/reference/levels/misty/misty-conveyor_REF.gc +++ b/test/decompiler/reference/levels/misty/misty-conveyor_REF.gc @@ -321,7 +321,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))) @@ -335,7 +335,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))) @@ -409,7 +409,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)) @@ -472,7 +472,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))) diff --git a/test/decompiler/reference/levels/misty/mistycannon_REF.gc b/test/decompiler/reference/levels/misty/mistycannon_REF.gc index 340c35d3f7..4083a69a6d 100644 --- a/test/decompiler/reference/levels/misty/mistycannon_REF.gc +++ b/test/decompiler/reference/levels/misty/mistycannon_REF.gc @@ -942,7 +942,7 @@ (collide-kind background) self t2-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) diff --git a/test/decompiler/reference/levels/ogre/flying-lurker_REF.gc b/test/decompiler/reference/levels/ogre/flying-lurker_REF.gc index 2c71de5c32..943d0f8b1e 100644 --- a/test/decompiler/reference/levels/ogre/flying-lurker_REF.gc +++ b/test/decompiler/reference/levels/ogre/flying-lurker_REF.gc @@ -397,7 +397,16 @@ (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) @@ -406,7 +415,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)) @@ -444,7 +453,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)) @@ -894,7 +903,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) @@ -1304,7 +1313,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)) diff --git a/test/decompiler/reference/levels/ogre/ogreboss_REF.gc b/test/decompiler/reference/levels/ogre/ogreboss_REF.gc index 118891e897..0fc30c98f1 100644 --- a/test/decompiler/reference/levels/ogre/ogreboss_REF.gc +++ b/test/decompiler/reference/levels/ogre/ogreboss_REF.gc @@ -49,7 +49,7 @@ ;; definition for symbol *ogreboss-missile-shadow-control*, type shadow-control (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 @@ ;; definition for symbol *ogreboss-shadow-control*, type shadow-control (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) @@ -131,7 +131,7 @@ (-> self root-override root-prim collide-with) (-> self parent-override 0) s4-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) ) ) @@ -267,7 +267,7 @@ (-> self root-override root-prim collide-with) t1-0 t2-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) ) ) diff --git a/test/decompiler/reference/levels/racer_common/racer_REF.gc b/test/decompiler/reference/levels/racer_common/racer_REF.gc index e2fb11b5a0..fb27c72f22 100644 --- a/test/decompiler/reference/levels/racer_common/racer_REF.gc +++ b/test/decompiler/reference/levels/racer_common/racer_REF.gc @@ -77,7 +77,7 @@ ;; definition for symbol *racer-shadow-control*, type shadow-control (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) diff --git a/test/decompiler/reference/levels/racer_common/target-racer_REF.gc b/test/decompiler/reference/levels/racer_common/target-racer_REF.gc index 20cd921713..27ad9975fc 100644 --- a/test/decompiler/reference/levels/racer_common/target-racer_REF.gc +++ b/test/decompiler/reference/levels/racer_common/target-racer_REF.gc @@ -25,7 +25,7 @@ :alignv 1.0 :slope-up-traction 1.0 :align-speed 1.0 - :flags (surface-flags surf00) + :flags (surface-flags allow-look-around) ) ) @@ -54,7 +54,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags (surface-flags surf00 surf11) + :flags (surface-flags allow-look-around jump) ) ) diff --git a/test/decompiler/reference/levels/rolling/rolling-robber_REF.gc b/test/decompiler/reference/levels/rolling/rolling-robber_REF.gc index 411bbdf3fe..cb4297efea 100644 --- a/test/decompiler/reference/levels/rolling/rolling-robber_REF.gc +++ b/test/decompiler/reference/levels/rolling/rolling-robber_REF.gc @@ -180,7 +180,7 @@ (collide-kind background) self t2-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) ) (v1-5 (new 'stack-no-clear 'vector)) diff --git a/test/decompiler/reference/levels/snow/ice-cube_REF.gc b/test/decompiler/reference/levels/snow/ice-cube_REF.gc index 7bc7ee18d8..fe0ce80d00 100644 --- a/test/decompiler/reference/levels/snow/ice-cube_REF.gc +++ b/test/decompiler/reference/levels/snow/ice-cube_REF.gc @@ -779,7 +779,7 @@ (collide-kind background) obj s3-1 - 1 + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) diff --git a/test/decompiler/reference/levels/snow/snow-ball_REF.gc b/test/decompiler/reference/levels/snow/snow-ball_REF.gc index d4dcbc635d..8330f37029 100644 --- a/test/decompiler/reference/levels/snow/snow-ball_REF.gc +++ b/test/decompiler/reference/levels/snow/snow-ball_REF.gc @@ -164,7 +164,7 @@ ;; definition for symbol *snow-ball-shadow-control*, type shadow-control (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) diff --git a/test/decompiler/reference/levels/snow/snow-flutflut-obs_REF.gc b/test/decompiler/reference/levels/snow/snow-flutflut-obs_REF.gc index e87d50045a..cc3f42b351 100644 --- a/test/decompiler/reference/levels/snow/snow-flutflut-obs_REF.gc +++ b/test/decompiler/reference/levels/snow/snow-flutflut-obs_REF.gc @@ -908,7 +908,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))) ) ) diff --git a/test/decompiler/reference/levels/snow/snow-ram-boss_REF.gc b/test/decompiler/reference/levels/snow/snow-ram-boss_REF.gc index 909378e075..dff4fe0e63 100644 --- a/test/decompiler/reference/levels/snow/snow-ram-boss_REF.gc +++ b/test/decompiler/reference/levels/snow/snow-ram-boss_REF.gc @@ -1268,7 +1268,7 @@ (collide-kind background cak-2 ground-object) obj t2-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) diff --git a/test/decompiler/reference/levels/sunken/bully_REF.gc b/test/decompiler/reference/levels/sunken/bully_REF.gc index 04124065fb..77a1d18be0 100644 --- a/test/decompiler/reference/levels/sunken/bully_REF.gc +++ b/test/decompiler/reference/levels/sunken/bully_REF.gc @@ -95,7 +95,7 @@ ;; definition for symbol *bully-shadow-control*, type shadow-control (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) @@ -510,14 +510,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) diff --git a/test/decompiler/reference/levels/sunken/double-lurker_REF.gc b/test/decompiler/reference/levels/sunken/double-lurker_REF.gc index 8ddfb33e48..486c0df918 100644 --- a/test/decompiler/reference/levels/sunken/double-lurker_REF.gc +++ b/test/decompiler/reference/levels/sunken/double-lurker_REF.gc @@ -330,7 +330,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)) @@ -530,7 +530,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) @@ -976,7 +976,7 @@ (collide-kind background) obj s4-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) diff --git a/test/decompiler/reference/levels/sunken/puffer_REF.gc b/test/decompiler/reference/levels/sunken/puffer_REF.gc index c79a2f9a81..7d159f4e78 100644 --- a/test/decompiler/reference/levels/sunken/puffer_REF.gc +++ b/test/decompiler/reference/levels/sunken/puffer_REF.gc @@ -199,12 +199,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))) @@ -218,7 +218,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 ) @@ -227,7 +227,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 ) @@ -624,7 +624,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) diff --git a/test/decompiler/reference/levels/sunken/target-tube_REF.gc b/test/decompiler/reference/levels/sunken/target-tube_REF.gc index efe50297b7..40abdb0644 100644 --- a/test/decompiler/reference/levels/sunken/target-tube_REF.gc +++ b/test/decompiler/reference/levels/sunken/target-tube_REF.gc @@ -54,7 +54,7 @@ :slope-up-traction 1.0 :align-speed 1.0 :mode 'air - :flags (surface-flags surf11) + :flags (surface-flags jump) ) ) @@ -105,7 +105,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) ) ) ) diff --git a/test/decompiler/reference/levels/swamp/kermit_REF.gc b/test/decompiler/reference/levels/swamp/kermit_REF.gc index 9f22a1fcb4..f91e8d5f97 100644 --- a/test/decompiler/reference/levels/swamp/kermit_REF.gc +++ b/test/decompiler/reference/levels/swamp/kermit_REF.gc @@ -820,7 +820,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)) diff --git a/test/decompiler/reference/levels/training/training-obs_REF.gc b/test/decompiler/reference/levels/training/training-obs_REF.gc index 04cd20263e..a2edad7580 100644 --- a/test/decompiler/reference/levels/training/training-obs_REF.gc +++ b/test/decompiler/reference/levels/training/training-obs_REF.gc @@ -114,7 +114,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) @@ -786,7 +786,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))) ) ) diff --git a/test/decompiler/reference/levels/village1/assistant_REF.gc b/test/decompiler/reference/levels/village1/assistant_REF.gc index 92f3c86aae..573c29d9ad 100644 --- a/test/decompiler/reference/levels/village1/assistant_REF.gc +++ b/test/decompiler/reference/levels/village1/assistant_REF.gc @@ -59,14 +59,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 ) diff --git a/test/decompiler/reference/levels/village1/explorer_REF.gc b/test/decompiler/reference/levels/village1/explorer_REF.gc index bd2d1df429..c88ec98291 100644 --- a/test/decompiler/reference/levels/village1/explorer_REF.gc +++ b/test/decompiler/reference/levels/village1/explorer_REF.gc @@ -57,14 +57,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 ) diff --git a/test/decompiler/reference/levels/village2/assistant-village2_REF.gc b/test/decompiler/reference/levels/village2/assistant-village2_REF.gc index ca5d3ae2df..0117914f82 100644 --- a/test/decompiler/reference/levels/village2/assistant-village2_REF.gc +++ b/test/decompiler/reference/levels/village2/assistant-village2_REF.gc @@ -98,14 +98,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 ) @@ -1260,7 +1260,7 @@ (collide-kind target) (the-as process #f) t2-0 - 1 + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) diff --git a/test/decompiler/reference/levels/village2/warrior_REF.gc b/test/decompiler/reference/levels/village2/warrior_REF.gc index 8aa480c80d..35e41bbba4 100644 --- a/test/decompiler/reference/levels/village2/warrior_REF.gc +++ b/test/decompiler/reference/levels/village2/warrior_REF.gc @@ -54,14 +54,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 ) diff --git a/test/decompiler/reference/levels/village3/assistant-village3_REF.gc b/test/decompiler/reference/levels/village3/assistant-village3_REF.gc index dbd70d86b1..b3d05604c7 100644 --- a/test/decompiler/reference/levels/village3/assistant-village3_REF.gc +++ b/test/decompiler/reference/levels/village3/assistant-village3_REF.gc @@ -54,14 +54,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 ) diff --git a/test/decompiler/reference/levels/village3/miners_REF.gc b/test/decompiler/reference/levels/village3/miners_REF.gc index 4b86bd4c8f..fddac569ae 100644 --- a/test/decompiler/reference/levels/village3/miners_REF.gc +++ b/test/decompiler/reference/levels/village3/miners_REF.gc @@ -76,14 +76,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 ) @@ -273,14 +273,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 ) diff --git a/test/decompiler/reference/levels/village3/sage-village3_REF.gc b/test/decompiler/reference/levels/village3/sage-village3_REF.gc index bddbaddac2..7218ca3a65 100644 --- a/test/decompiler/reference/levels/village3/sage-village3_REF.gc +++ b/test/decompiler/reference/levels/village3/sage-village3_REF.gc @@ -307,13 +307,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 ) ) diff --git a/test/decompiler/reference/levels/village3/village3-obs_REF.gc b/test/decompiler/reference/levels/village3/village3-obs_REF.gc index 66fdfc7507..c77c89b0a4 100644 --- a/test/decompiler/reference/levels/village3/village3-obs_REF.gc +++ b/test/decompiler/reference/levels/village3/village3-obs_REF.gc @@ -231,7 +231,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))) ) ) diff --git a/test/decompiler/reference/levels/village_common/villagep-obs_REF.gc b/test/decompiler/reference/levels/village_common/villagep-obs_REF.gc index 07c9294b2d..40fb6cd1df 100644 --- a/test/decompiler/reference/levels/village_common/villagep-obs_REF.gc +++ b/test/decompiler/reference/levels/village_common/villagep-obs_REF.gc @@ -1015,7 +1015,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)