diff --git a/decompiler/config/all-types.gc b/decompiler/config/all-types.gc index 4840a2d06e..c498e918c1 100644 --- a/decompiler/config/all-types.gc +++ b/decompiler/config/all-types.gc @@ -13927,13 +13927,52 @@ ;; Containing DGOs - ['GAME', 'ENGINE'] ;; Version - 3 +;; - Enums + +(defenum cam-slave-options + :bitfield #t + (BUTT_CAM) + (SAME_SIDE) + (MOVE_SPHERICAL) + (ALLOW_Z_ROT) + (JUMP_PITCHES) + (COLLIDE) + (FIND_HIDDEN_TARGET) + (DRAG) + (PLAYER_MOVING_CAMERA) + (LINE_OF_SIGHT) + (MOVEMENT_BLOCKED) + (SHRINK_MAX_ANGLE) + (GOTO_GOOD_POINT) + (BLOCK_SHIFT_BUTTONS) + (BIKE_MODE) + (NO_ROTATE) + (STICKY_ANGLE) + (AIR_EXIT) + ) + +(defenum cam-index-options + :type uint32 + :bitfield #t + (RADIAL) + (SPHERICAL) + ) + +(defenum slave-los-state + :type uint32 + (none 0) + (cw 1) + (ccw 2) + (between 3) + ) + ;; - Types (deftype camera-bank (basic) ((collide-move-rad float :offset-assert 4) (joypad uint32 :offset-assert 8) (min-detectable-velocity float :offset-assert 12) - (attack-timeout uint64 :offset-assert 16) + (attack-timeout seconds :offset-assert 16) (default-string-max-y meters :offset-assert 24) (default-string-min-y meters :offset-assert 28) (default-string-max-z meters :offset-assert 32) @@ -13947,7 +13986,7 @@ ) (deftype cam-index (structure) - ((flags uint32 :offset-assert 0) + ((flags cam-index-options :offset-assert 0) (vec vector 2 :inline :offset 16) ) :method-count-assert 11 @@ -14118,7 +14157,7 @@ (velocity vector :inline :offset-assert 2208) (desired-pos vector :inline :offset-assert 2224) (time-dist-too-far uint32 :offset-assert 2240) - (los-state uint32 :offset-assert 2244) + (los-state slave-los-state :offset-assert 2244) (good-point vector :inline :offset-assert 2256) (los-tgt-spline-pt int32 :offset-assert 2272) (los-tgt-spline-pt-incarnation int32 :offset-assert 2276) @@ -18173,10 +18212,10 @@ ;; - Functions -(define-extern camera-bounding-box-draw (function bounding-box basic rgba none)) +(define-extern camera-bounding-box-draw (function bounding-box none)) (define-extern collide-planes-test0 function) (define-extern collide-planes-test1 function) -(define-extern camera-cross (function vector vector vector vector float basic)) +(define-extern camera-cross (function vector vector vector vector4w meters basic)) (define-extern collide-planes-intersect function) (define-extern collide-planes function) @@ -18322,8 +18361,8 @@ (define-extern cam-slave-init-vars (function none :behavior camera-slave)) (define-extern cam-calc-follow! (function cam-rotation-tracker vector symbol vector)) (define-extern slave-set-rotation! (function cam-rotation-tracker vector float float symbol none)) -(define-extern camera-slave-debug (function camera-slave object object object object)) ;; passed to engine::method-15 -(define-extern camera-line-rel-len (function tracking-point vector float rgba none)) +(define-extern camera-slave-debug (function camera-slave object)) ;; passed to engine::method-15 +(define-extern camera-line-rel-len (function vector vector float vector4w none)) (define-extern cam-slave-get-flags (function entity symbol uint128)) (define-extern cam-slave-get-vector-with-offset (function entity-actor vector symbol symbol)) (define-extern cam-slave-get-fov (function entity float)) @@ -18409,7 +18448,7 @@ (define-extern list-keeper-init (function none :behavior camera-master)) (define-extern master-track-target (function symbol :behavior camera-master)) ;; TODO - go get that collide-cache function (define-extern master-check-regions (function object :behavior camera-master)) -(define-extern camera-master-debug (function camera-master symbol symbol none)) +(define-extern camera-master-debug (function camera-master none)) (define-extern master-unset-region (function object :behavior camera-master)) (define-extern reset-target-tracking (function symbol :behavior camera-master)) (define-extern reset-drawable-tracking (function symbol :behavior camera-master)) @@ -18544,7 +18583,7 @@ (define-extern cam-string-line-of-sight (function vector :behavior camera-slave)) (define-extern cam-string-joystick (function vector :behavior camera-slave)) (define-extern cam-string-find-hidden (function none :behavior camera-slave)) -(define-extern cam-collision-record-save (function vector vector int basic camera-slave none)) +(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)) @@ -18553,7 +18592,7 @@ (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-setup-lateral (function clip-travel-vector-to-mesh-return-info vector vector symbol :behavior camera-slave)) -(define-extern slave-los-state->string (function uint string)) ;; uint comes from 2244 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)) (define-extern dist-info-valid? (function collide-los-dist-info symbol)) (define-extern dist-info-append (function collide-los-dist-info vector none)) @@ -18931,17 +18970,17 @@ (define-extern cam-layout-save-maxAngle (function symbol string entity-actor string)) (define-extern cam-layout-save-campoints-flags (function symbol string entity-actor string)) (define-extern cam-layout-save-focalpull-flags (function symbol string entity-actor string)) -(define-extern cam-index-options->string (function uint string string)) -(define-extern cam-slave-options->string (function uint string string)) +(define-extern cam-index-options->string (function cam-index-options object string)) +(define-extern cam-slave-options->string (function cam-slave-options object string)) (define-extern fov->maya (function float float)) (define-extern cam-layout-entity-volume-info-create (function entity-camera symbol symbol :behavior cam-layout)) ;; TODO - decomp crash (define-extern clmf-next-volume (function int symbol :behavior cam-layout)) (define-extern clmf-input (function vector vector int vector)) -(define-extern camera-fov-frame (function matrix vector float float float vector none)) +(define-extern camera-fov-frame (function matrix vector float float float vector4w none)) (define-extern interp-test (function (function vector vector vector float vector float none) interp-test-info basic)) (define-extern v-slrp! (function vector vector vector float vector)) (define-extern interp-test-deg (function (function vector vector vector vector float none) interp-test-info basic)) -(define-extern camera-line-setup (function vector none)) +(define-extern camera-line-setup (function vector4w none)) (define-extern camera-line-draw (function vector vector symbol)) (define-extern cam-layout-intersect-dist (function vector vector vector float)) (define-extern clmf-button-test (function symbol)) @@ -19078,18 +19117,18 @@ (define-extern cam-collision-record-draw (function none)) (define-extern master-draw-coordinates (function vector none)) -(define-extern cam-debug-draw-tris (function basic basic rgba symbol)) +(define-extern cam-debug-draw-tris (function symbol)) (define-extern cam-collision-record-step (function int none)) -(define-extern camera-sphere (function vector float rgba none)) -(define-extern camera-line-rel (function vector vector rgba none)) -(define-extern camera-fov-draw (function int int vector float float vector symbol)) +(define-extern camera-sphere (function vector float vector none)) +(define-extern camera-line-rel (function vector vector vector4w none)) +(define-extern camera-fov-draw (function int int vector float float vector4w symbol)) (define-extern cam-line-dma (function pointer)) (define-extern camera-line2d (function (pointer vector4w) (pointer vector4w) pointer)) (define-extern camera-plot-float-func (function float float float float (function float float) vector4w none)) (define-extern cam-debug-add-coll-tri (function cam-debug-tri vector cam-debug-tri none)) (define-extern debug-euler (function cam-dbg-scratch object)) (define-extern bike-cam-limit (function float float)) -(define-extern external-cam-reset! (function none)) ;; TODO - unconfirmed +(define-extern external-cam-reset! (function none)) ;; - Unknowns @@ -19104,9 +19143,9 @@ (define-extern *cam-collision-record* cam-collision-record-array) ;; unknown type (define-extern *cam-collision-record-last* int) ;; unknown type (define-extern *cam-collision-record-first* int) ;; unknown type -(define-extern *cam-debug-los-tri* (pointer cam-debug-tri)) ;; unknown type +(define-extern *cam-debug-los-tri* (inline-array cam-debug-tri)) ;; unknown type (define-extern *cam-debug-los-tri-current* int) ;; unknown type -(define-extern *cam-debug-coll-tri* (pointer cam-debug-tri)) ;; unknown type +(define-extern *cam-debug-coll-tri* (inline-array cam-debug-tri)) ;; unknown type (define-extern *cam-debug-coll-tri-current* int) ;; unknown type @@ -19392,13 +19431,13 @@ (swim-jump-height-max meters :offset-assert 68) (tube-jump-height-min meters :offset-assert 72) (tube-jump-height-max meters :offset-assert 76) - (wheel-duration uint64 :offset-assert 80) - (wheel-jump-pre-window uint64 :offset-assert 88) - (wheel-jump-post-window uint64 :offset-assert 96) - (wheel-timeout uint64 :offset-assert 104) + (wheel-duration seconds :offset-assert 80) + (wheel-jump-pre-window seconds :offset-assert 88) + (wheel-jump-post-window seconds :offset-assert 96) + (wheel-timeout seconds :offset-assert 104) (wheel-speed-min meters :offset-assert 112) (wheel-speed-inc meters :offset-assert 116) - (wheel-flip-duration uint64 :offset-assert 120) + (wheel-flip-duration seconds :offset-assert 120) (wheel-flip-height meters :offset-assert 128) (wheel-flip-dist meters :offset-assert 132) (wheel-flip-art-height meters :offset-assert 136) @@ -19406,13 +19445,13 @@ (duck-slide-distance meters :offset-assert 144) (fall-far meters :offset-assert 148) (fall-far-inc meters :offset-assert 152) - (attack-timeout uint64 :offset-assert 160) - (ground-timeout uint64 :offset-assert 168) - (slide-down-timeout uint64 :offset-assert 176) - (fall-timeout uint64 :offset-assert 184) + (attack-timeout seconds :offset-assert 160) + (ground-timeout seconds :offset-assert 168) + (slide-down-timeout seconds :offset-assert 176) + (fall-timeout seconds :offset-assert 184) (fall-stumble-threshold meters :offset-assert 192) (yellow-projectile-speed meters :offset-assert 196) - (hit-invulnerable-timeout uint64 :offset-assert 200) + (hit-invulnerable-timeout seconds :offset-assert 200) (run-cycle-length float :offset-assert 208) (walk-cycle-dist meters :offset-assert 212) (walk-up-cycle-dist meters :offset-assert 216) @@ -19454,7 +19493,7 @@ (stuck-distance meters :offset-assert 576) (tongue-pull-speed-min float :offset-assert 580) (tongue-pull-speed-max float :offset-assert 584) - (yellow-attack-timeout uint64 :offset-assert 592) + (yellow-attack-timeout seconds :offset-assert 592) ) :method-count-assert 9 :size-assert #x258 @@ -19485,7 +19524,7 @@ (define-extern set-forward-vel (function float vector :behavior target)) (define-extern delete-back-vel (function float none :behavior target)) (define-extern set-side-vel (function float vector :behavior target)) -(define-extern target-timed-invulnerable (function uint target none)) ;; TODO - likely useconds +(define-extern target-timed-invulnerable (function seconds target none)) (define-extern target-timed-invulnerable-off (function target none)) (define-extern ground-tween-initialize (function ground-tween-info uint uint uint uint uint uint ground-tween-info :behavior target)) ;; TODO - dealing with inline-array issues (define-extern ground-tween-update (function ground-tween-info float float none :behavior target)) ;; TODO - inline array issues as well diff --git a/decompiler/config/jak1_ntsc_black_label/label_types.jsonc b/decompiler/config/jak1_ntsc_black_label/label_types.jsonc index 0d0f11e28f..93fd7a4b2d 100644 --- a/decompiler/config/jak1_ntsc_black_label/label_types.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/label_types.jsonc @@ -697,8 +697,8 @@ ["L832", "vector4w"], ["L872", "float", true], ["L873", "float", true], - ["L874", "(pointer float)", 1], - ["L875", "(pointer float)", 1], + ["L874", "float", true], + ["L875", "float", true], ["L876", "float", true], ["L877", "float", true], ["L878", "float", true], @@ -735,51 +735,51 @@ ], "cam-debug": [ - ["L174", "rgba", true], - ["L175", "rgba", true], - ["L176", "rgba", true], - ["L177", "rgba", true], - ["L178", "rgba", true], - ["L209", "rgba", true], - ["L210", "rgba", true], - ["L211", "rgba", true], - ["L212", "rgba", true], - ["L213", "rgba", true], - ["L214", "rgba", true], - ["L215", "rgba", true], - ["L216", "rgba", true], - ["L217", "rgba", true], - ["L218", "rgba", true], - ["L219", "rgba", true], - ["L220", "rgba", true], - ["L221", "rgba", true], - ["L222", "rgba", true], - ["L223", "rgba", true], - ["L224", "rgba", true], - ["L225", "rgba", true], - ["L226", "rgba", true], - ["L227", "rgba", true], - ["L228", "rgba", true], - ["L229", "rgba", true], - ["L230", "rgba", true], - ["L231", "rgba", true], - ["L232", "rgba", true], - ["L233", "rgba", true], - ["L234", "rgba", true], - ["L239", "rgba", true], - ["L240", "rgba", true], - ["L241", "rgba", true], - ["L242", "rgba", true], + ["L174", "vector4w"], + ["L175", "vector4w"], + ["L176", "vector4w"], + ["L177", "vector4w"], + ["L178", "vector4w"], + ["L209", "vector4w"], + ["L210", "vector4w"], + ["L211", "vector4w"], + ["L212", "vector4w"], + ["L213", "vector4w"], + ["L214", "vector4w"], + ["L215", "vector4w"], + ["L216", "vector4w"], + ["L217", "vector4w"], + ["L218", "vector4w"], + ["L219", "vector4w"], + ["L220", "vector4w"], + ["L221", "vector4w"], + ["L222", "vector4w"], + ["L223", "vector4w"], + ["L224", "vector4w"], + ["L225", "vector4w"], + ["L226", "vector4w"], + ["L227", "vector4w"], + ["L228", "vector4w"], + ["L229", "vector4w"], + ["L230", "vector4w"], + ["L231", "vector4w"], + ["L232", "vector4w"], + ["L233", "vector4w"], + ["L234", "vector4w"], + ["L239", "vector4w"], + ["L240", "vector4w"], + ["L241", "vector4w"], + ["L242", "vector4w"], ["L243", "vector"], ["L244", "vector"], - ["L245", "rgba", true], + ["L245", "vector4w"], ["L246", "vector"], ["L247", "vector"], ["L254", "vector"], ["L255", "vector"], ["L256", "vector"], ["L257", "vector"], - ["L263", "rgba", true] + ["L263", "vector4w"] ], "sparticle-launcher": [["L192", "adgif-shader"]], diff --git a/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc b/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc index 4ba7fed3b3..f5977d6b86 100644 --- a/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc @@ -3677,9 +3677,9 @@ [86, "s2", "vector"], [92, "s2", "vector"], [94, "s5", "vector"], - [95, "s5", "vector"], - [96, "s2", "vector"], - [97, "s2", "vector"], + [95, "s5", "symbol"], + [96, "s2", "symbol"], + [97, "s2", "symbol"], [110, "s5", "vector"], [113, "s5", "vector"], [115, "s5", "vector"], @@ -4085,5 +4085,12 @@ [24, "a0", "process-drawable"] ], + "cam-collision-record-draw": [ + [[44, 275], "s5", "cam-collision-record"] + ], + "cam-collision-record-save": [ + [[8, 56], "v1", "cam-collision-record"] + ], + "placeholder-do-not-add-below": [] } diff --git a/decompiler/config/jak1_ntsc_black_label/var_names.jsonc b/decompiler/config/jak1_ntsc_black_label/var_names.jsonc index 3294d1f560..e9a469b681 100644 --- a/decompiler/config/jak1_ntsc_black_label/var_names.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/var_names.jsonc @@ -3624,5 +3624,24 @@ } }, + "cam-collision-record-draw": { + "vars": { + "s5-0": ["s5-0", "cam-collision-record"] + } + }, + + "cam-collision-record-save": { + "vars": { + "v1-5": ["v1-5", "cam-collision-record"] + } + }, + + "cam-layout-save-cam-trans": { + "vars": { + "s5-1": ["s5-1", "vector"], + "s2-1": ["s2-1", "vector"] + } + }, + "aaaaaaaaaaaaaaaaaaaaaaa": {} } diff --git a/decompiler/config/jak1_pal/type_casts.jsonc b/decompiler/config/jak1_pal/type_casts.jsonc index d182444d8d..d6e6956738 100644 --- a/decompiler/config/jak1_pal/type_casts.jsonc +++ b/decompiler/config/jak1_pal/type_casts.jsonc @@ -473,7 +473,7 @@ [527, "a0", "(pointer gs-fogcol)"], [[588, 591], "v1", "dma-packet"], - [[672, 675], "v1", "dma-packet"] + [[678, 681], "v1", "dma-packet"] ], "load-game-text-info": [[4, "v1", "game-text-info"]], @@ -883,7 +883,7 @@ ], "main-cheats": [ - [[1123, 1126], "v1", "dma-packet"] + [[1327, 1330], "v1", "dma-packet"] ], "on": [[33, "t9", "(function cpu-thread function none)"]], diff --git a/decompiler/config/jak1_pal/var_names.jsonc b/decompiler/config/jak1_pal/var_names.jsonc index 2b098dfac2..9639e7f389 100644 --- a/decompiler/config/jak1_pal/var_names.jsonc +++ b/decompiler/config/jak1_pal/var_names.jsonc @@ -2382,12 +2382,12 @@ "v1-158": "cheatmode-debug-state", "v1-303": "cheat-language-state", "v1-394": "cheat-pal-state", - "s5-9": "dma-buff", - "gp-9": "dma-start", - "v1-533": ["dma-pkt", "dma-packet"], - "gp-10": "timeout", - "v1-548": "inactive-timeout", - "gp-11": "game-end-proc" + "s5-11": "dma-buff", + "gp-11": "dma-start", + "v1-626": ["dma-pkt", "dma-packet"], + "gp-12": "timeout", + "v1-641": "inactive-timeout", + "gp-13": "game-end-proc" } }, diff --git a/decompiler/util/data_decompile.cpp b/decompiler/util/data_decompile.cpp index 1cd0fba08b..8a25bc612d 100644 --- a/decompiler/util/data_decompile.cpp +++ b/decompiler/util/data_decompile.cpp @@ -599,6 +599,24 @@ goos::Object decompile_structure(const TypeSpec& type, continue; } idx++; + + // O(N^2)-1 approach to the score system? but I didn't notice any slowdowns and there are + // ultimately not many static allocs + bool higher_score_available = false; + for (auto& other_field : type_info->fields()) { + if (other_field == field) + continue; + if (other_field.offset() == field.offset() && + other_field.field_score() > field.field_score()) { + higher_score_available = true; + break; + } + } + if (higher_score_available) { + // a higher priority field is available + continue; + } + // first, let's see if this overlaps with anything: auto field_start = field.offset(); auto field_end = field_start + ts.get_size_in_type(field); diff --git a/goal_src/engine/camera/cam-debug-h.gc b/goal_src/engine/camera/cam-debug-h.gc index 5d07b7fd7c..79ca442374 100644 --- a/goal_src/engine/camera/cam-debug-h.gc +++ b/goal_src/engine/camera/cam-debug-h.gc @@ -6,19 +6,19 @@ ;; dgos: GAME, ENGINE ;; TODO - for cam-layout -(define-extern camera-line-setup (function vector none)) +(define-extern camera-line-setup (function vector4w none)) (define-extern camera-line-draw (function vector vector symbol)) (define-extern camera-line (function vector vector vector4w none)) -(define-extern camera-cross (function vector vector vector vector float basic)) -(define-extern camera-fov-frame (function matrix vector float float float vector none)) -(define-extern cam-slave-options->string (function uint string string)) -(define-extern cam-index-options->string (function uint string string)) +(define-extern camera-cross (function vector vector vector vector4w meters basic)) +(define-extern camera-fov-frame (function matrix vector float float float vector4w none)) +(define-extern cam-slave-options->string (function cam-slave-options object string)) +(define-extern cam-index-options->string (function cam-index-options object string)) (define-extern debug-set-camera-pos-rot! (function vector matrix vector)) -(define-extern camera-slave-debug (function camera-slave object object object object)) ;; passed to engine::method-15 +(define-extern camera-slave-debug (function camera-slave object)) ;; passed to engine::method-15 ;; TODO - for cam-states (define-extern cam-debug-add-los-tri (function (inline-array collide-cache-tri) vector vector none)) -(define-extern cam-collision-record-save (function vector vector int basic camera-slave none)) -(define-extern slave-los-state->string (function uint string)) ;; uint comes from 2244 camera-slave +(define-extern cam-collision-record-save (function vector vector int symbol camera-slave none)) +(define-extern slave-los-state->string (function slave-los-state string)) (define-extern cam-debug-reset-coll-tri (function none)) ;; not confirmed (declare-type clm basic) diff --git a/goal_src/engine/camera/cam-debug.gc b/goal_src/engine/camera/cam-debug.gc index fdbc34e775..80d1702ab8 100644 --- a/goal_src/engine/camera/cam-debug.gc +++ b/goal_src/engine/camera/cam-debug.gc @@ -5,3 +5,28 @@ ;; name in dgo: cam-debug ;; dgos: GAME, ENGINE +(when *debug-segment* + +(defun external-cam-reset! () + (vector-reset! (-> *math-camera* trans)) + (matrix-identity! (-> *math-camera* inv-camera-rot)) + (when *camera-combiner* + (let* ((v1-6 (-> *math-camera* inv-camera-rot)) + (a3-0 (-> *camera-combiner* inv-camera-rot)) + (a0-2 (-> a3-0 vector 0 quad)) + (a1-0 (-> a3-0 vector 1 quad)) + (a2-0 (-> a3-0 vector 2 quad)) + (a3-1 (-> a3-0 vector 3 quad)) + ) + (set! (-> v1-6 vector 0 quad) a0-2) + (set! (-> v1-6 vector 1 quad) a1-0) + (set! (-> v1-6 vector 2 quad) a2-0) + (set! (-> v1-6 vector 3 quad) a3-1) + ) + (set! (-> *math-camera* trans quad) (-> *camera-combiner* trans quad)) + ) + 0 + (none) + ) + +) \ No newline at end of file diff --git a/goal_src/engine/camera/cam-layout.gc b/goal_src/engine/camera/cam-layout.gc index 7da856315c..c1d993ab76 100644 --- a/goal_src/engine/camera/cam-layout.gc +++ b/goal_src/engine/camera/cam-layout.gc @@ -442,11 +442,7 @@ ) (else (let ((s5-0 (-> *volume-descriptor* pos-vol gp-0))) - (let - ((a0-7 - (new 'static 'vector4w :data (new 'static 'array int32 4 0 0 0 #x80)) - ) - ) + (let ((a0-7 (new 'static 'vector4w :w #x80))) (cond ((= (-> s5-0 volume-type) 'vol) (set! (-> a0-7 x) 0) @@ -466,7 +462,7 @@ 0 ) ) - (camera-line-setup (the-as vector a0-7)) + (camera-line-setup a0-7) ) (let ((s4-0 (the-as object (-> s5-0 first-point)))) (dotimes (s3-0 (/ (-> s5-0 point-count) 2)) @@ -582,7 +578,7 @@ (new 'static 'vector :y 1024.0) (new 'static 'vector :z 1024.0) gp-0 - (the-as vector (-> arg1 color)) + (-> arg1 color) (-> (new 'static 'array float 1 4096.0) 0) ) ) @@ -633,7 +629,7 @@ (new 'static 'vector :y 1024.0) (new 'static 'vector :z 1024.0) gp-0 - (the-as vector (-> arg1 color)) + (-> arg1 color) (-> (new 'static 'array float 1 4096.0) 0) ) ) @@ -661,10 +657,7 @@ (* 0.5 (cam-slave-get-fov arg0)) (-> (new 'static 'array float 1 0.75) 0) (-> (new 'static 'array float 1 1.0) 0) - (the-as - vector - (new 'static 'vector4w :data (new 'static 'array int32 4 0 0 #xff #x80)) - ) + (new 'static 'vector4w :z #xff :w #x80) ) ) ) @@ -681,10 +674,7 @@ (new 'static 'vector :y 1024.0) (new 'static 'vector :z 1024.0) s5-1 - (the-as - vector - (new 'static 'vector4w :data (new 'static 'array int32 4 #x80 0 0 #x80)) - ) + (new 'static 'vector4w :x #x80 :w #x80) (-> (new 'static 'array float 1 4096.0) 0) ) ) @@ -702,10 +692,7 @@ (new 'static 'vector :y 1024.0) (new 'static 'vector :z 1024.0) s5-2 - (the-as - vector - (new 'static 'vector4w :data (new 'static 'array int32 4 0 #x80 0 #x80)) - ) + (new 'static 'vector4w :y #x80 :w #x80) (-> (new 'static 'array float 1 4096.0) 0) ) ) @@ -723,13 +710,7 @@ (new 'static 'vector :y 1024.0) (new 'static 'vector :z 1024.0) s5-3 - (the-as - vector - (new 'static 'vector4w - :data - (new 'static 'array int32 4 #x80 0 #x80 #x80) - ) - ) + (new 'static 'vector4w :x #x80 :z #x80 :w #x80) (-> (new 'static 'array float 1 4096.0) 0) ) ) @@ -746,7 +727,7 @@ s3-1 'campath 'campath-k - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) ) (or (!= *camera-layout-blink* 'spline) @@ -768,7 +749,7 @@ arg0 'spline-offset 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) s4-1 (the-as (pointer res-tag) #f) *res-static-buf* @@ -789,14 +770,7 @@ s3-1 ) (vector+! s5-4 s5-4 s4-1) - (camera-line - s2-0 - s5-4 - (new 'static 'vector4w - :data - (new 'static 'array int32 4 #xff #xff 0 #x80) - ) - ) + (camera-line s2-0 s5-4 (new 'static 'vector4w :x #xff :y #xff :w #x80)) ) (curve-get-pos! s5-4 (-> *CAM_LAYOUT-bank* spline-t) s3-1) (vector+! s5-4 s5-4 s4-1) @@ -804,13 +778,7 @@ (new 'static 'vector :y 1024.0) (new 'static 'vector :z 1024.0) s5-4 - (the-as - vector - (new 'static 'vector4w - :data - (new 'static 'array int32 4 #xff #xff 0 #x80) - ) - ) + (new 'static 'vector4w :x #xff :y #xff :w #x80) (-> (new 'static 'array float 1 4096.0) 0) ) ) @@ -823,13 +791,7 @@ ) (when (and - (get-curve-data! - arg0 - s3-2 - 'intro - 'intro-k - (-> (new 'static 'array float 1 -1000000000.0) 0) - ) + (get-curve-data! arg0 s3-2 'intro 'intro-k (the-as float -1000000000.0)) (or (!= *camera-layout-blink* 'intro) (logtest? (-> *display* real-actual-frame-counter) 8) @@ -845,7 +807,7 @@ s1-2 'campath 'campath-k - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) ) (curve-get-pos! s4-2 (-> (new 'static 'array float 1 0.0) 0) s1-2) (curve-get-pos! s5-5 (-> (new 'static 'array float 1 1.0) 0) s3-2) @@ -866,11 +828,7 @@ s3-2 ) (vector+! s5-5 s5-5 s4-2) - (camera-line - s2-1 - s5-5 - (new 'static 'vector4w :data (new 'static 'array int32 4 0 0 #xff #x80)) - ) + (camera-line s2-1 s5-5 (new 'static 'vector4w :z #xff :w #x80)) ) (curve-get-pos! s5-5 (-> *CAM_LAYOUT-bank* intro-t) s3-2) (vector+! s5-5 s5-5 s4-2) @@ -878,10 +836,7 @@ (new 'static 'vector :y 1024.0) (new 'static 'vector :z 1024.0) s5-5 - (the-as - vector - (new 'static 'vector4w :data (new 'static 'array int32 4 0 0 #xff #x80)) - ) + (new 'static 'vector4w :z #xff :w #x80) (-> (new 'static 'array float 1 4096.0) 0) ) (curve-get-pos! @@ -898,10 +853,7 @@ (new 'static 'vector :y 1024.0) (new 'static 'vector :z 1024.0) s5-5 - (the-as - vector - (new 'static 'vector4w :data (new 'static 'array int32 4 0 0 #xff #x80)) - ) + (new 'static 'vector4w :z #xff :w #x80) (-> (new 'static 'array float 1 4096.0) 0) ) ) @@ -922,7 +874,7 @@ 'campoints-offset structure :time - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) ) ) (s4-3 (new 'stack-no-clear 'vector)) @@ -947,23 +899,13 @@ (set! (-> s3-3 quad) (-> (the-as (pointer uint128) (&+ s2-3 16)))) ) ) - (camera-line - s4-3 - s3-3 - (new 'static 'vector4w :data (new 'static 'array int32 4 0 #x80 0 #x80)) - ) + (camera-line s4-3 s3-3 (new 'static 'vector4w :y #x80 :w #x80)) (vector-lerp-clamp! s5-6 s4-3 s3-3 (-> *CAM_LAYOUT-bank* spline-t)) (camera-cross (new 'static 'vector :y 1024.0) (new 'static 'vector :z 1024.0) s5-6 - (the-as - vector - (new 'static 'vector4w - :data - (new 'static 'array int32 4 #xff #xff 0 #x80) - ) - ) + (new 'static 'vector4w :x #xff :y #xff :w #x80) (-> (new 'static 'array float 1 4096.0) 0) ) ) @@ -991,7 +933,7 @@ (camera-line (the-as vector (&+ s4-4 0)) (the-as vector (&+ s4-4 16)) - (new 'static 'vector4w :data (new 'static 'array int32 4 0 #xff #xff #x80)) + (new 'static 'vector4w :y #xff :z #xff :w #x80) ) (vector-lerp-clamp! s5-7 @@ -1003,13 +945,7 @@ (new 'static 'vector :y 1024.0) (new 'static 'vector :z 1024.0) s5-7 - (the-as - vector - (new 'static 'vector4w - :data - (new 'static 'array int32 4 0 #xff #xff #x80) - ) - ) + (new 'static 'vector4w :y #xff :z #xff :w #x80) (-> (new 'static 'array float 1 4096.0) 0) ) ) @@ -1026,18 +962,12 @@ (camera-line (-> s5-8 from) (-> s5-8 origin) - (new 'static 'vector4w - :data - (new 'static 'array int32 4 #x80 #x80 #x80 #x80) - ) + (new 'static 'vector4w :x #x80 :y #x80 :z #x80 :w #x80) ) (camera-line (-> s5-8 to) (-> s5-8 origin) - (new 'static 'vector4w - :data - (new 'static 'array int32 4 #x80 #x80 #x80 #x80) - ) + (new 'static 'vector4w :x #x80 :y #x80 :z #x80 :w #x80) ) (vector-! (-> s5-8 from) (-> s5-8 from) (-> s5-8 origin)) (vector-! (-> s5-8 to) (-> s5-8 to) (-> s5-8 origin)) @@ -1047,10 +977,7 @@ (camera-line (-> s5-8 origin) s4-5 - (new 'static 'vector4w - :data - (new 'static 'array int32 4 #x80 #x80 #x80 #x80) - ) + (new 'static 'vector4w :x #x80 :y #x80 :z #x80 :w #x80) ) (when (not (paused?)) (+! (-> *CAM_LAYOUT-bank* debug-t) (-> *CAM_LAYOUT-bank* debug-step)) @@ -1061,10 +988,7 @@ ) (set! (-> s5-8 axis) #f) (set! (-> s5-8 disp) "li") - (set! - (-> s5-8 color) - (new 'static 'vector4w :data (new 'static 'array int32 4 #xff 0 0 #x80)) - ) + (set! (-> s5-8 color) (new 'static 'vector4w :x #xff :w #x80)) (interp-test (the-as (function vector vector vector float vector float none) @@ -1073,47 +997,32 @@ s5-8 ) (set! (-> s5-8 disp) "si") - (set! - (-> s5-8 color) - (new 'static 'vector4w :data (new 'static 'array int32 4 0 #xff 0 #x80)) - ) + (set! (-> s5-8 color) (new 'static 'vector4w :y #xff :w #x80)) (interp-test (the-as (function vector vector vector float vector float none) v-slrp!) s5-8 ) (set! (-> s5-8 disp) "si2") - (set! - (-> s5-8 color) - (new 'static 'vector4w :data (new 'static 'array int32 4 0 0 #xff #x80)) - ) + (set! (-> s5-8 color) (new 'static 'vector4w :z #xff :w #x80)) (interp-test (the-as (function vector vector vector float vector float none) v-slrp2!) s5-8 ) (set! (-> s5-8 disp) "si3") - (set! - (-> s5-8 color) - (new 'static 'vector4w :data (new 'static 'array int32 4 #xff 0 #xff #x80)) - ) + (set! (-> s5-8 color) (new 'static 'vector4w :x #xff :z #xff :w #x80)) (interp-test-deg (the-as (function vector vector vector vector float none) v-slrp3!) s5-8 ) (set! (-> s5-8 axis) (-> *camera* local-down)) (set! (-> s5-8 disp) "si2d") - (set! - (-> s5-8 color) - (new 'static 'vector4w :data (new 'static 'array int32 4 0 #xff #xff #x80)) - ) + (set! (-> s5-8 color) (new 'static 'vector4w :y #xff :z #xff :w #x80)) (interp-test (the-as (function vector vector vector float vector float none) v-slrp2!) s5-8 ) (set! (-> s5-8 disp) "si3d") - (set! - (-> s5-8 color) - (new 'static 'vector4w :data (new 'static 'array int32 4 #xff #xff 0 #x80)) - ) + (set! (-> s5-8 color) (new 'static 'vector4w :x #xff :y #xff :w #x80)) (interp-test-deg (the-as (function vector vector vector vector float none) v-slrp3!) s5-8 @@ -1303,7 +1212,7 @@ arg0 structure :time - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) ) ) (add-data! @@ -1325,7 +1234,7 @@ arg0 structure :time - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) ) ) (when @@ -1353,7 +1262,7 @@ arg1 structure :time - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) ) ) (add-data! @@ -1378,7 +1287,7 @@ arg1 structure :time - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) ) ) (when @@ -1405,7 +1314,7 @@ (the-as vector s3-1) (the-as vector s3-1) s4-0 - (-> (new 'static 'array float 1 409.6) 0) + (the-as float 409.6) ) (cond ((not arg1) @@ -1578,7 +1487,7 @@ ) (defbehavior clmf-to-edit cam-layout () - (set! (-> self res-key) (-> (new 'static 'array float 1 -1000000000.0) 0)) + (set! (-> self res-key) -1000000000.0) (set! *clm* *clm-edit*) #t ) @@ -1621,7 +1530,7 @@ 'rot-offset vector :time - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) ) ) ) @@ -1669,14 +1578,17 @@ (format (clear *res-key-string*) "~S~S" 'trans '-offset) (let ((s5-1 - (s5-0 - s2-0 - (string->symbol *res-key-string*) - 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) - #f - (the-as (pointer res-tag) #f) - *res-static-buf* + (the-as + vector + (s5-0 + s2-0 + (string->symbol *res-key-string*) + 'interp + (the-as float -1000000000.0) + #f + (the-as (pointer res-tag) #f) + *res-static-buf* + ) ) ) ) @@ -1685,9 +1597,9 @@ (res-lump-struct arg2 'translation_info - structure + vector :time - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) ) ) (s3-1 (new-stack-vector0)) @@ -1702,33 +1614,33 @@ ) ) (set! (-> s3-1 quad) (-> s1-0 quad)) - (when s5-1 + (when (the-as structure s5-1) (if arg0 (format #t "offset ~M ~M ~M (added)~%" - (-> (the-as vector s5-1) x) - (-> (the-as vector s5-1) y) - (-> (the-as vector s5-1) z) + (-> s5-1 x) + (-> s5-1 y) + (-> s5-1 z) ) ) - (vector+! s3-1 s3-1 (the-as vector s5-1)) + (vector+! s3-1 s3-1 s5-1) ) - (when (the-as vector s2-1) + (when s2-1 (if arg0 (format #t "level-trans ~M ~M ~M (subtracted)~%" - (-> (the-as vector s2-1) x) - (-> (the-as vector s2-1) y) - (-> (the-as vector s2-1) z) + (-> s2-1 x) + (-> s2-1 y) + (-> s2-1 z) ) ) - (vector-! s3-1 s3-1 (the-as vector s2-1)) + (vector-! s3-1 s3-1 s2-1) ) - (set! s2-1 (or (the-as vector s5-1) s2-1)) + (set! s2-1 (the-as vector (or s5-1 s2-1))) (set! arg0 (and (the-as symbol s2-1) arg0)) - (if (the-as structure arg0) + (if arg0 (format #t "final trans ~M ~M ~M (maya)~%" @@ -1738,13 +1650,13 @@ ) ) ) - (the-as string (if (the-as vector s5-1) + (the-as string (if s5-1 (format arg1 " tag trans-offset METERS(~M) METERS(~M) METERS(~M) 1.0 // vector~%" - (-> (the-as vector s5-1) x) - (-> (the-as vector s5-1) y) - (-> (the-as vector s5-1) z) + (-> s5-1 x) + (-> s5-1 y) + (-> s5-1 z) ) ) ) @@ -1755,13 +1667,7 @@ (defun cam-layout-save-pivot ((arg0 symbol) (arg1 string) (arg2 entity-actor)) (let ((s2-0 - (res-lump-struct - arg2 - 'pivot - vector - :time - (-> (new 'static 'array float 1 -1000000000.0) 0) - ) + (res-lump-struct arg2 'pivot vector :time (the-as float -1000000000.0)) ) (s3-0 (method-of-type res-lump get-property-struct)) ) @@ -1774,7 +1680,7 @@ arg2 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) #f (the-as (pointer res-tag) #f) *res-static-buf* @@ -1831,13 +1737,7 @@ (defun cam-layout-save-align ((arg0 symbol) (arg1 string) (arg2 entity-actor)) (let ((s2-0 - (res-lump-struct - arg2 - 'align - vector - :time - (-> (new 'static 'array float 1 -1000000000.0) 0) - ) + (res-lump-struct arg2 'align vector :time (the-as float -1000000000.0)) ) (s3-0 (method-of-type res-lump get-property-struct)) ) @@ -1850,7 +1750,7 @@ arg2 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) #f (the-as (pointer res-tag) #f) *res-static-buf* @@ -1914,7 +1814,7 @@ 'interesting vector :time - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) ) ) (s3-0 (method-of-type res-lump get-property-struct)) @@ -1928,7 +1828,7 @@ arg2 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) #f (the-as (pointer res-tag) #f) *res-static-buf* @@ -1989,7 +1889,7 @@ arg2 'fov 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2004,7 +1904,7 @@ arg2 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2052,7 +1952,7 @@ arg2 'focalPull 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2067,7 +1967,7 @@ arg2 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2101,13 +2001,7 @@ (defun cam-layout-save-flags ((arg0 symbol) (arg1 string) (arg2 entity-actor)) (let ((s4-0 - (res-lump-value - arg2 - 'flags - uint128 - :time - (-> (new 'static 'array float 1 -1000000000.0) 0) - ) + (res-lump-value arg2 'flags uint128 :time (the-as float -1000000000.0)) ) (s5-0 (method-of-type res-lump get-property-value)) (s1-0 arg2) @@ -2119,7 +2013,7 @@ s1-0 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (the-as uint128 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2134,7 +2028,7 @@ arg2 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (the-as uint128 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2143,17 +2037,17 @@ ) (when arg0 (format #t "setup flags ") - (cam-slave-options->string (the-as uint s4-0) (the-as string #t)) + (cam-slave-options->string (the-as cam-slave-options s4-0) #t) (format #t "~%") (format #t "forced on ") - (cam-slave-options->string (the-as uint s5-1) (the-as string #t)) + (cam-slave-options->string (the-as cam-slave-options s5-1) #t) (format #t "~%") (format #t "forced off ") - (cam-slave-options->string (the-as uint s3-1) (the-as string #t)) + (cam-slave-options->string (the-as cam-slave-options s3-1) #t) (format #t "~%") (let ((s4-1 (logclear (logior s4-0 s5-1) s3-1))) (format #t "final ") - (cam-slave-options->string (the-as uint s4-1) (the-as string #t)) + (cam-slave-options->string (the-as cam-slave-options s4-1) #t) ) (format #t "~%") ) @@ -2185,7 +2079,7 @@ 'focalpull-flags uint128 :time - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) ) ) (s5-0 (method-of-type res-lump get-property-value)) @@ -2198,7 +2092,7 @@ s1-0 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (the-as uint128 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2213,7 +2107,7 @@ arg2 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (the-as uint128 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2222,17 +2116,17 @@ ) (when arg0 (format #t "setup focalpull-flags ") - (cam-index-options->string (the-as uint s4-0) (the-as string #t)) + (cam-index-options->string (the-as cam-index-options s4-0) #t) (format #t "~%") (format #t "forced on ") - (cam-index-options->string (the-as uint s5-1) (the-as string #t)) + (cam-index-options->string (the-as cam-index-options s5-1) #t) (format #t "~%") (format #t "forced off ") - (cam-index-options->string (the-as uint s3-1) (the-as string #t)) + (cam-index-options->string (the-as cam-index-options s3-1) #t) (format #t "~%") (let ((s4-1 (logclear (logior s4-0 s5-1) s3-1))) (format #t "final ") - (cam-index-options->string (the-as uint s4-1) (the-as string #t)) + (cam-index-options->string (the-as cam-index-options s4-1) #t) ) (format #t "~%") ) @@ -2264,7 +2158,7 @@ 'campoints-flags uint128 :time - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) ) ) (s5-0 (method-of-type res-lump get-property-value)) @@ -2277,7 +2171,7 @@ s1-0 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (the-as uint128 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2292,7 +2186,7 @@ arg2 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (the-as uint128 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2301,17 +2195,17 @@ ) (when arg0 (format #t "setup campoints-flags ") - (cam-index-options->string (the-as uint s4-0) (the-as string #t)) + (cam-index-options->string (the-as cam-index-options s4-0) #t) (format #t "~%") (format #t "forced on ") - (cam-index-options->string (the-as uint s5-1) (the-as string #t)) + (cam-index-options->string (the-as cam-index-options s5-1) #t) (format #t "~%") (format #t "forced off ") - (cam-index-options->string (the-as uint s3-1) (the-as string #t)) + (cam-index-options->string (the-as cam-index-options s3-1) #t) (format #t "~%") (let ((s4-1 (logclear (logior s4-0 s5-1) s3-1))) (format #t "final ") - (cam-index-options->string (the-as uint s4-1) (the-as string #t)) + (cam-index-options->string (the-as cam-index-options s4-1) #t) ) (format #t "~%") ) @@ -2342,7 +2236,7 @@ arg2 'intro-time 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2357,7 +2251,7 @@ arg2 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2400,7 +2294,7 @@ arg2 'intro-exitValue 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2415,7 +2309,7 @@ arg2 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2453,7 +2347,7 @@ arg2 'interpTime 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2468,7 +2362,7 @@ arg2 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2502,20 +2396,14 @@ (when (and (not - (res-lump-struct - arg2 - 'pivot - structure - :time - (-> (new 'static 'array float 1 -1000000000.0) 0) - ) + (res-lump-struct arg2 'pivot structure :time (the-as float -1000000000.0)) ) (res-lump-struct arg2 'spline-offset structure :time - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) ) ) (let @@ -2525,7 +2413,7 @@ 'spline-offset vector :time - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) ) ) ) @@ -2560,19 +2448,13 @@ (when (and (not - (res-lump-struct - arg2 - 'pivot - structure - :time - (-> (new 'static 'array float 1 -1000000000.0) 0) - ) + (res-lump-struct arg2 'pivot structure :time (the-as float -1000000000.0)) ) ((method-of-type res-lump get-property-value-float) arg2 'spline-follow-dist-offset 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (the-as float #f) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2584,7 +2466,7 @@ arg2 'spline-follow-dist-offset 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2616,7 +2498,7 @@ 'campoints-offset vector :time - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) ) ) ) @@ -2651,7 +2533,7 @@ arg2 'tiltAdjust 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2666,7 +2548,7 @@ arg2 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2701,7 +2583,7 @@ arg2 'stringMinLength 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2716,7 +2598,7 @@ arg2 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2751,7 +2633,7 @@ arg2 'stringMaxLength 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2766,7 +2648,7 @@ arg2 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2801,7 +2683,7 @@ arg2 'stringMinHeight 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2816,7 +2698,7 @@ arg2 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2851,7 +2733,7 @@ arg2 'stringMaxHeight 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2866,7 +2748,7 @@ arg2 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2901,7 +2783,7 @@ arg2 'stringCliffHeight 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2916,7 +2798,7 @@ arg2 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2949,7 +2831,7 @@ arg2 'maxAngle 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2964,7 +2846,7 @@ arg2 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2998,13 +2880,7 @@ (format *temp-string* "dd_next/caminfo/~s.cam" - (res-lump-struct - arg0 - 'name - structure - :time - (-> (new 'static 'array float 1 -1000000000.0) 0) - ) + (res-lump-struct arg0 'name structure :time (the-as float -1000000000.0)) ) (format *temp-string* "dd_next/caminfo/garbage") ) @@ -3013,26 +2889,14 @@ (format #t "---------camera '~S'------------~%" - (res-lump-struct - arg0 - 'name - structure - :time - (-> (new 'static 'array float 1 -1000000000.0) 0) - ) + (res-lump-struct arg0 'name structure :time (the-as float -1000000000.0)) ) ) (format s4-2 "#include /next/config_data/standard.m2d~%") (format s4-2 "camera ~s {~%" - (res-lump-struct - arg0 - 'name - structure - :time - (-> (new 'static 'array float 1 -1000000000.0) 0) - ) + (res-lump-struct arg0 'name structure :time (the-as float -1000000000.0)) ) (cam-layout-save-cam-rot arg1 @@ -3158,7 +3022,7 @@ 'name structure :time - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) ) ) ) @@ -3473,7 +3337,7 @@ (-> self cam-entity) arg0 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -3586,7 +3450,7 @@ :tag-ptr (& sv-16) :time - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) ) ) ) @@ -4884,13 +4748,7 @@ (format *temp-string* "\"~S\"~%" - (res-lump-struct - s3-0 - 'name - structure - :time - (-> (new 'static 'array float 1 -1000000000.0) 0) - ) + (res-lump-struct s3-0 'name structure :time (the-as float -1000000000.0)) ) ) ) @@ -5067,7 +4925,7 @@ ) (defbehavior cam-layout-init cam-layout () - (set! (-> self res-key) (-> (new 'static 'array float 1 -1000000000.0) 0)) + (set! (-> self res-key) -1000000000.0) (set! (-> self num-entities) 0) (let ((v1-2 (-> *camera-engine* alive-list next0))) *camera-engine* diff --git a/goal_src/engine/camera/cam-master.gc b/goal_src/engine/camera/cam-master.gc index b3a64c23e1..de7252757c 100644 --- a/goal_src/engine/camera/cam-master.gc +++ b/goal_src/engine/camera/cam-master.gc @@ -819,41 +819,22 @@ (set! (-> self stringMinLength) (-> *CAMERA-bank* default-string-min-z)) (set! (-> self stringMaxLength) (-> *CAMERA-bank* default-string-max-z)) (set! (-> self stringCliffHeight) 163840.0) - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 1) - (set! (-> a1-0 message) 'point-of-interest) - (set! (-> a1-0 param 0) (the-as uint #f)) - (send-event-function *camera* a1-0) - ) + (send-event *camera* 'point-of-interest #f) (set! (-> *camera-combiner* tracking point-of-interest-blend target) 0.0) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) self) (set! (-> a1-1 num-params) 1) (set! (-> a1-1 message) 'query-state) (set! (-> a1-1 param 0) (the-as uint *camera-base-mode*)) - (when (not (send-event-function *camera* a1-1)) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) 'change-state) - (set! (-> a1-2 param 0) (the-as uint *camera-base-mode*)) - (set! (-> a1-2 param 1) (the-as uint 450)) - (send-event-function *camera* a1-2) - ) + (if (not (send-event-function *camera* a1-1)) + (send-event *camera* 'change-state *camera-base-mode* 450) ) ) (set! (-> *camera-combiner* tracking tilt-adjust target) (-> *CAMERA-bank* default-tilt-adjust) ) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) self) - (set! (-> a1-3 num-params) 1) - (set! (-> a1-3 message) 'clear-slave-option) - (set! (-> a1-3 param 0) (the-as uint #x10000)) - (send-event-function *camera* a1-3) - ) + (send-event *camera* 'clear-slave-option #x10000) ) ) @@ -892,19 +873,13 @@ ) ) (let ((s5-0 (new 'stack-no-clear 'vector))) - (when + (if (cam-slave-get-vector-with-offset (the-as entity-actor arg0) s5-0 'interesting ) - (let ((a1-5 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-5 from) self) - (set! (-> a1-5 num-params) 1) - (set! (-> a1-5 message) 'point-of-interest) - (set! (-> a1-5 param 0) (the-as uint s5-0)) - (send-event-function *camera* a1-5) - ) + (send-event *camera* 'point-of-interest s5-0) ) ) (if (< 405504.0 (-> self stringMaxLength)) @@ -919,25 +894,12 @@ (set! (-> a1-7 num-params) 1) (set! (-> a1-7 message) 'query-state) (set! (-> a1-7 param 0) (the-as uint *camera-base-mode*)) - (when (not (send-event-function *camera* a1-7)) - (let ((a1-8 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-8 from) self) - (set! (-> a1-8 num-params) 2) - (set! (-> a1-8 message) 'change-state) - (set! (-> a1-8 param 0) (the-as uint *camera-base-mode*)) - (set! (-> a1-8 param 1) (the-as uint 450)) - (send-event-function *camera* a1-8) - ) + (if (not (send-event-function *camera* a1-7)) + (send-event *camera* 'change-state *camera-base-mode* 450) ) ) - (when (logtest? #x10000 (cam-slave-get-flags (-> self cam-entity) 'flags)) - (let ((a1-10 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-10 from) self) - (set! (-> a1-10 num-params) 1) - (set! (-> a1-10 message) 'set-slave-option) - (set! (-> a1-10 param 0) (the-as uint #x10000)) - (send-event-function *camera* a1-10) - ) + (if (logtest? #x10000 (cam-slave-get-flags (-> self cam-entity) 'flags)) + (send-event *camera* 'set-slave-option #x10000) ) (let ((f0-12 @@ -1044,164 +1006,101 @@ (when s4-2 (dotimes (s3-2 (the-as int (-> sv-16 elt-count))) (let ((s2-0 (entity-by-name (-> s4-2 s3-2)))) - (set! v0-21 (the-as none (cond - (s2-0 - (let ((s0-0 (cam-state-from-entity s2-0))) - (cond - ((= s0-0 *camera-base-mode*) - (deactivate (-> gp-0 0)) - (master-base-region s2-0) - (return #t) - v0-21 - ) - (else - (the-as none (cond - (s0-0 - (set! - sv-112 - (get-process - *camera-dead-pool* - camera-slave - #x4000 - ) - ) - (let ((s1-0 (when sv-112 - (let - ((t9-15 - (method-of-type - camera-slave - activate - ) - ) - ) - (t9-15 - (the-as - camera-slave - sv-112 - ) - self - 'camera-slave - (the-as - pointer - #x70004000 - ) - ) - ) - (run-now-in-process - sv-112 - cam-slave-init - s0-0 - s2-0 - ) - (-> - sv-112 - ppointer - ) - ) - ) - ) - (the-as none (cond - (s1-0 - (setup-slave-for-hopefull - (the-as - camera-slave - (ppointer->process - s1-0 - ) - ) - ) - (cond - ((master-is-hopeful-better? - (the-as - camera-slave - (ppointer->process - gp-0 - ) - ) - (the-as - camera-slave - (ppointer->process - s1-0 - ) - ) - ) - (deactivate - (-> - gp-0 - 0 - ) - ) - (set! - gp-0 - s1-0 - ) - gp-0 - ) - (else - (deactivate - (-> - s1-0 - 0 - ) - ) - ) - ) - ) - (else - (format - 0 - "ERROR : alternate region activate failed~%" - ) - ) - ) - ) - ) - ) - (else - (let ((s1-1 format) - (s0-1 0) - ) - (set! - sv-128 - "ERROR : alternate camera region '~S' didn't produce a state~%" - ) - (let - ((a2-10 - (res-lump-struct - s2-0 - 'name - structure - ) - ) - ) - (s1-1 s0-1 sv-128 a2-10) - ) - ) - ) - ) - ) - ) - ) - ) - ) - (else - (let ((s2-1 format) - (s1-2 0) - (s0-2 - "ERROR : alternate '~S' not found for '~S'~%" - ) + (set! v0-21 (cond + (s2-0 + (let ((s0-0 (cam-state-from-entity s2-0))) + (cond + ((= s0-0 *camera-base-mode*) + (deactivate (-> gp-0 0)) + (master-base-region s2-0) + (return #t) + v0-21 + ) + (s0-0 + (set! + sv-112 + (get-process *camera-dead-pool* camera-slave #x4000) + ) + (let ((s1-0 (when sv-112 + (let + ((t9-15 + (method-of-type camera-slave activate) ) - (set! sv-144 (-> s4-2 s3-2)) - (let - ((a3-8 - (res-lump-struct arg0 'name structure) + ) + (t9-15 + (the-as camera-slave sv-112) + self + 'camera-slave + (the-as pointer #x70004000) + ) ) + (run-now-in-process + sv-112 + cam-slave-init + s0-0 + s2-0 + ) + (-> sv-112 ppointer) ) - (s2-1 s1-2 s0-2 sv-144 a3-8) - ) - ) - ) - ) + ) + ) + (cond + (s1-0 + (setup-slave-for-hopefull + (the-as camera-slave (ppointer->process s1-0)) + ) + (cond + ((master-is-hopeful-better? + (the-as camera-slave (ppointer->process gp-0)) + (the-as camera-slave (ppointer->process s1-0)) + ) + (deactivate (-> gp-0 0)) + (set! gp-0 s1-0) + gp-0 + ) + (else + (deactivate (-> s1-0 0)) + ) + ) + ) + (else + (format + 0 + "ERROR : alternate region activate failed~%" + ) + ) + ) + ) + ) + (else + (let ((s1-1 format) + (s0-1 0) + ) + (set! + sv-128 + "ERROR : alternate camera region '~S' didn't produce a state~%" + ) + (let ((a2-10 (res-lump-struct s2-0 'name structure))) + (s1-1 s0-1 sv-128 a2-10) + ) + ) + ) + ) + ) + ) + (else + (let ((s2-1 format) + (s1-2 0) + (s0-2 + "ERROR : alternate '~S' not found for '~S'~%" + ) + ) + (set! sv-144 (-> s4-2 s3-2)) + (let ((a3-8 (res-lump-struct arg0 'name structure))) + (s2-1 s1-2 s0-2 sv-144 a3-8) + ) + ) + ) ) ) ) @@ -1224,14 +1123,7 @@ (if (nonzero? (-> self force-blend)) (set! v1-48 (min v1-48 (the-as int (-> self force-blend-time)))) ) - (let ((a1-16 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-16 from) self) - (set! (-> a1-16 num-params) 2) - (set! (-> a1-16 message) 'change-state) - (set! (-> a1-16 param 0) (the-as uint (ppointer->process gp-0))) - (set! (-> a1-16 param 1) (the-as uint v1-48)) - (send-event-function *camera* a1-16) - ) + (send-event *camera* 'change-state (ppointer->process gp-0) v1-48) ) #t ) diff --git a/goal_src/engine/camera/cam-states.gc b/goal_src/engine/camera/cam-states.gc index fe89db446a..9800238471 100644 --- a/goal_src/engine/camera/cam-states.gc +++ b/goal_src/engine/camera/cam-states.gc @@ -2144,13 +2144,13 @@ (set! f30-0 (fmin f30-0 (- (-> arg0 next-normal w)))) ) (cond - ((= (-> self los-state) 2) + ((= (-> self los-state) (slave-los-state ccw)) (if *display-cam-los-debug* (format *stdcon* "straddle stick ccw~%") ) (vector-normalize! arg1 (+ f28-0 (-> *CAM_STRING-bank* los-coll-rad))) ) - ((= (-> self los-state) 1) + ((= (-> self los-state) (slave-los-state cw)) (if *display-cam-los-debug* (format *stdcon* "straddle stick cw~%") ) @@ -2201,7 +2201,7 @@ (if *display-cam-los-debug* (format *stdcon* "straddle diagonal ccw~%") ) - (set! (-> self los-state) (the-as uint 2)) + (set! (-> self los-state) (slave-los-state ccw)) (vector-normalize! arg1 (+ f28-0 (-> *CAM_STRING-bank* los-coll-rad))) ) ((and @@ -2247,21 +2247,21 @@ (if *display-cam-los-debug* (format *stdcon* "straddle diagonal cw~%") ) - (set! (-> self los-state) (the-as uint 1)) + (set! (-> self los-state) (slave-los-state cw)) (vector-normalize! arg1 (- f30-0 (-> *CAM_STRING-bank* los-coll-rad))) ) ((< f28-0 (- f30-0)) (if *display-cam-los-debug* (format *stdcon* "straddle ccw~%") ) - (set! (-> self los-state) (the-as uint 2)) + (set! (-> self los-state) (slave-los-state ccw)) (vector-normalize! arg1 (+ f28-0 (-> *CAM_STRING-bank* los-coll-rad))) ) (else (if *display-cam-los-debug* (format *stdcon* "straddle cw~%") ) - (set! (-> self los-state) (the-as uint 1)) + (set! (-> self los-state) (slave-los-state cw)) (vector-normalize! arg1 (- f30-0 (-> *CAM_STRING-bank* los-coll-rad))) ) ) @@ -2280,7 +2280,7 @@ (if *display-cam-los-debug* (format *stdcon* "diagonal ccw~%") ) - (set! (-> self los-state) (the-as uint 2)) + (set! (-> self los-state) (slave-los-state ccw)) (vector-normalize! arg1 (- (-> *CAM_STRING-bank* los-coll-rad) (-> arg0 next-normal z)) @@ -2299,7 +2299,7 @@ (if *display-cam-los-debug* (format *stdcon* "diagonal cw~%") ) - (set! (-> self los-state) (the-as uint 1)) + (set! (-> self los-state) (slave-los-state cw)) (vector-normalize! arg1 (- (-> arg0 intersection z) (-> *CAM_STRING-bank* los-coll-rad)) @@ -2309,14 +2309,14 @@ (dist-info-valid? (the-as collide-los-dist-info (-> arg0 intersection))) (dist-info-valid? (the-as collide-los-dist-info (-> arg0 next-normal))) ) - (set! (-> self los-state) (the-as uint 3)) + (set! (-> self los-state) (slave-los-state between)) (vector-normalize! arg1 (the-as float 0.0001)) ) ((dist-info-valid? (the-as collide-los-dist-info (-> arg0 intersection))) (if *display-cam-los-debug* (format *stdcon* "regular cw~%") ) - (set! (-> self los-state) (the-as uint 1)) + (set! (-> self los-state) (slave-los-state cw)) (vector-normalize! arg1 (- (-> arg0 intersection z) (-> *CAM_STRING-bank* los-coll-rad)) @@ -2326,14 +2326,14 @@ (if *display-cam-los-debug* (format *stdcon* "regular ccw~%") ) - (set! (-> self los-state) (the-as uint 2)) + (set! (-> self los-state) (slave-los-state ccw)) (vector-normalize! arg1 (- (-> *CAM_STRING-bank* los-coll-rad) (-> arg0 next-normal z)) ) ) (else - (set! (-> self los-state) (the-as uint 0)) + (set! (-> self los-state) (slave-los-state none)) (vector-reset! arg1) ) ) @@ -2859,9 +2859,15 @@ ) ((= (-> self string-vel-dir) 5) ) - ((and (= (-> self string-vel-dir) 2) (= (-> self los-state) 1)) + ((and + (= (-> self string-vel-dir) 2) + (= (-> self los-state) (slave-los-state cw)) + ) ) - ((and (= (-> self string-vel-dir) 1) (= (-> self los-state) 2)) + ((and + (= (-> self string-vel-dir) 1) + (= (-> self los-state) (slave-los-state ccw)) + ) ) ) (when *display-cam-los-debug* @@ -2973,7 +2979,10 @@ ) ((and (< f30-0 f28-0) - (or (= (-> self los-state) 2) (= (-> self los-state) 1)) + (or + (= (-> self los-state) (slave-los-state ccw)) + (= (-> self los-state) (slave-los-state cw)) + ) ) (vector-normalize! (-> self view-flat) f30-0) ) @@ -3006,7 +3015,11 @@ (vector-! s5-0 s5-0 (-> self string-trans)) (cam-los-collide (-> self string-trans) s5-0 gp-0 4098) (when (-> gp-0 vert-next y) - (when (or (= (-> self los-state) 2) (= (-> self los-state) 1)) + (when + (or + (= (-> self los-state) (slave-los-state ccw)) + (= (-> self los-state) (slave-los-state cw)) + ) (let ((a0-6 (new 'stack-no-clear 'vector))) (vector-! a0-6 (-> *camera* tpos-curr) (-> *camera* tpos-old)) (if @@ -3168,7 +3181,10 @@ ) ((and (< 0.0 f28-0) - (or (= (-> self los-state) 2) (= (-> self los-state) 1)) + (or + (= (-> self los-state) (slave-los-state ccw)) + (= (-> self los-state) (slave-los-state cw)) + ) ) ) ((< (* 0.05 (- 1.0 f0-16)) f28-0) @@ -3238,7 +3254,7 @@ ) ) (cond - ((and (= (-> self los-state) 2) (< 0.0 f0-29)) + ((and (= (-> self los-state) (slave-los-state ccw)) (< 0.0 f0-29)) (let ((f0-34 (fmax @@ -3257,7 +3273,7 @@ ) ) ) - ((and (= (-> self los-state) 1) (< f0-29 0.0)) + ((and (= (-> self los-state) (slave-los-state cw)) (< f0-29 0.0)) (let ((f0-40 (fmax diff --git a/goal_src/engine/camera/camera-h.gc b/goal_src/engine/camera/camera-h.gc index a5f9badd47..65c03bbfbc 100644 --- a/goal_src/engine/camera/camera-h.gc +++ b/goal_src/engine/camera/camera-h.gc @@ -21,7 +21,7 @@ (define-extern cam-spline (state camera-slave)) (define-extern *camera-base-mode* state) (define-extern cam-fixed-read-entity (state camera-slave)) -(define-extern camera-line-rel-len (function tracking-point vector float rgba none)) +(define-extern camera-line-rel-len (function vector vector float vector4w none)) (define-extern cam-calc-follow! (function cam-rotation-tracker vector symbol vector)) (define-extern slave-set-rotation! (function cam-rotation-tracker vector float float symbol none)) ;; TODO - for cam-combiner @@ -31,14 +31,50 @@ (define-extern cam-master-init (function none :behavior camera-master)) -;; decomp begins +(defenum cam-slave-options + :bitfield #t + (BUTT_CAM) + (SAME_SIDE) + (MOVE_SPHERICAL) + (ALLOW_Z_ROT) + (JUMP_PITCHES) + (COLLIDE) + (FIND_HIDDEN_TARGET) + (DRAG) + (PLAYER_MOVING_CAMERA) + (LINE_OF_SIGHT) + (MOVEMENT_BLOCKED) + (SHRINK_MAX_ANGLE) + (GOTO_GOOD_POINT) + (BLOCK_SHIFT_BUTTONS) + (BIKE_MODE) + (NO_ROTATE) + (STICKY_ANGLE) + (AIR_EXIT) + ) + +(defenum cam-index-options + :type uint32 + :bitfield #t + (RADIAL) + (SPHERICAL) + ) + +(defenum slave-los-state + :type uint32 + (none 0) + (cw 1) + (ccw 2) + (between 3) + ) + +;; DECOMP BEGINS -;; definition of type camera-bank (deftype camera-bank (basic) ((collide-move-rad float :offset-assert 4) (joypad uint32 :offset-assert 8) (min-detectable-velocity float :offset-assert 12) - (attack-timeout uint64 :offset-assert 16) + (attack-timeout seconds :offset-assert 16) (default-string-max-y meters :offset-assert 24) (default-string-min-y meters :offset-assert 28) (default-string-max-z meters :offset-assert 32) @@ -51,74 +87,74 @@ :flag-assert #x900000030 ) -;; definition for symbol *CAMERA-bank*, type camera-bank -(define *CAMERA-bank* - (new 'static 'camera-bank - :collide-move-rad 1638.4 - :min-detectable-velocity 40.96 - :attack-timeout #x4b - :default-string-max-y (meters 3.0) - :default-string-min-y (meters 1.0) - :default-string-max-z (meters 12.5) - :default-string-min-z (meters 5.0) - :default-string-push-z (meters 10.0) - :default-tilt-adjust (degrees -6.5000005) - ) + +(define + *CAMERA-bank* + (new 'static 'camera-bank + :collide-move-rad 1638.4 + :min-detectable-velocity 40.96 + :attack-timeout (seconds 0.25) + :default-string-max-y (meters 3.0) + :default-string-min-y (meters 1.0) + :default-string-max-z (meters 12.5) + :default-string-min-z (meters 5.0) + :default-string-push-z (meters 10.0) + :default-tilt-adjust (degrees -6.5000005) + ) ) -;; definition of type cam-index (deftype cam-index (structure) - ((flags uint32 :offset-assert 0) - (vec vector 2 :inline :offset 16) + ((flags cam-index-options :offset-assert 0) + (vec vector 2 :inline :offset 16) ) :method-count-assert 11 :size-assert #x30 :flag-assert #xb00000030 (:methods (dummy-9 (_type_ symbol entity vector curve) symbol 9) - (dummy-10 (_type_ vector) float 10) ; inlined vector-dot issue? + (dummy-10 (_type_ vector) float 10) ) ) -;; definition of type tracking-point + (deftype tracking-point (structure) - ((position vector :inline :offset-assert 0) - (direction vector :inline :offset-assert 16) - (tp-length float :offset-assert 32) - (next int32 :offset-assert 36) - (incarnation int32 :offset-assert 40) + ((position vector :inline :offset-assert 0) + (direction vector :inline :offset-assert 16) + (tp-length float :offset-assert 32) + (next int32 :offset-assert 36) + (incarnation int32 :offset-assert 40) ) :method-count-assert 9 :size-assert #x2c :flag-assert #x90000002c ) -;; definition of type tracking-spline-sampler + (deftype tracking-spline-sampler (structure) - ((cur-pt int32 :offset-assert 0) - (partial-pt float :offset-assert 4) + ((cur-pt int32 :offset-assert 0) + (partial-pt float :offset-assert 4) ) :method-count-assert 9 :size-assert #x8 :flag-assert #x900000008 ) -;; definition of type tracking-spline + (deftype tracking-spline (structure) - ((point tracking-point 32 :inline :offset-assert 0) - (summed-len float :offset-assert 1536) - (free-point int32 :offset-assert 1540) - (used-point int32 :offset-assert 1544) - (partial-point float :offset-assert 1548) - (end-point int32 :offset-assert 1552) - (next-to-last-point int32 :offset-assert 1556) - (max-move float :offset-assert 1560) - (sample-len float :offset-assert 1564) - (used-count int32 :offset-assert 1568) - (old-position vector :inline :offset-assert 1584) - (debug-old-position vector :inline :offset-assert 1600) - (debug-out-position vector :inline :offset-assert 1616) - (debug-last-point int32 :offset-assert 1632) + ((point tracking-point 32 :inline :offset-assert 0) + (summed-len float :offset-assert 1536) + (free-point int32 :offset-assert 1540) + (used-point int32 :offset-assert 1544) + (partial-point float :offset-assert 1548) + (end-point int32 :offset-assert 1552) + (next-to-last-point int32 :offset-assert 1556) + (max-move float :offset-assert 1560) + (sample-len float :offset-assert 1564) + (used-count int32 :offset-assert 1568) + (old-position vector :inline :offset-assert 1584) + (debug-old-position vector :inline :offset-assert 1600) + (debug-out-position vector :inline :offset-assert 1616) + (debug-last-point int32 :offset-assert 1632) ) :method-count-assert 24 :size-assert #x664 @@ -132,7 +168,7 @@ (TODO-RENAME-14 (_type_ vector) none 14) (TODO-RENAME-15 (_type_) none 15) (TODO-RENAME-16 (_type_ float) none 16) - (TODO-RENAME-17 (_type_ vector float float symbol) int 17) ; - return value is actually none but they do a manual `return` + (TODO-RENAME-17 (_type_ vector float float symbol) int 17) (TODO-RENAME-18 (_type_ float vector tracking-spline-sampler) vector 18) (TODO-RENAME-19 (_type_ float vector tracking-spline-sampler) vector 19) (TODO-RENAME-20 (_type_ vector int) none 20) @@ -142,121 +178,121 @@ ) ) -;; cam-float-seeker moves value toward target in a smooth way, with second order dynamics. -;; The acceleration is proportional to the error. -;; This isn't stable by itself, so there is a velocity limit (proportional to distance) applied. + (deftype cam-float-seeker (structure) - ((target float :offset-assert 0) - (value float :offset-assert 4) - (vel float :offset-assert 8) - (accel float :offset-assert 12) - (max-vel float :offset-assert 16) - (max-partial float :offset-assert 20) + ((target float :offset-assert 0) + (value float :offset-assert 4) + (vel float :offset-assert 8) + (accel float :offset-assert 12) + (max-vel float :offset-assert 16) + (max-partial float :offset-assert 20) ) :pack-me :method-count-assert 13 :size-assert #x18 :flag-assert #xd00000018 (:methods - (init-cam-float-seeker (_type_ float float float float) none 9) - (copy-cam-float-seeker (_type_ _type_) none 10) - (update! (_type_ float) none 11) - (jump-to-target! (_type_ float) float 12) - ) + (init-cam-float-seeker (_type_ float float float float) none 9) + (copy-cam-float-seeker (_type_ _type_) none 10) + (update! (_type_ float) none 11) + (jump-to-target! (_type_ float) float 12) + ) ) -;; definition for method 9 of type cam-float-seeker -;; INFO: Return type mismatch int vs none. -(defmethod init-cam-float-seeker cam-float-seeker ((obj cam-float-seeker) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) + +(defmethod + init-cam-float-seeker + cam-float-seeker + ((obj cam-float-seeker) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) (set! (-> obj target) arg0) (set! (-> obj value) arg0) (set! (-> obj vel) 0.0) (set! (-> obj accel) arg1) (set! (-> obj max-vel) arg2) (set! (-> obj max-partial) arg3) + 0 (none) ) -;; definition for method 10 of type cam-float-seeker -;; INFO: Return type mismatch int vs none. -(defmethod copy-cam-float-seeker cam-float-seeker ((obj cam-float-seeker) (arg0 cam-float-seeker)) +(defmethod + copy-cam-float-seeker + cam-float-seeker + ((obj cam-float-seeker) (arg0 cam-float-seeker)) (set! (-> obj target) (-> arg0 target)) (set! (-> obj value) (-> arg0 value)) (set! (-> obj vel) (-> arg0 vel)) (set! (-> obj accel) (-> arg0 accel)) (set! (-> obj max-vel) (-> arg0 max-vel)) (set! (-> obj max-partial) (-> arg0 max-partial)) + 0 (none) ) (defmethod update! cam-float-seeker ((obj cam-float-seeker) (offset float)) - "Seek toward target + offset" + 0.0 + 0.0 (let* ((pos-error (- (+ (-> obj target) offset) (-> obj value))) - ;; the velocity limit based on distance to target (partial-velocity-limit (* (-> obj max-partial) (fabs pos-error))) ) - - ;; apply acceleration to velocity - (let ((daccel (* pos-error (* (-> obj accel) (-> *display* time-adjust-ratio))))) - (+! (-> obj vel) daccel) - ) - - ;; limit velocity using max-vel and the partial limit - (let ((abs-vel (fabs (-> obj vel))) - (abs-vel-limit (fmin partial-velocity-limit (-> obj max-vel))) - ) - (if (< abs-vel-limit abs-vel) - (set! (-> obj vel) (* (-> obj vel) (/ abs-vel-limit abs-vel))) - ) - ) + (let + ((daccel (* pos-error (* (-> obj accel) (-> *display* time-adjust-ratio))))) + (+! (-> obj vel) daccel) ) - - ;; update position + (let ((abs-vel (fabs (-> obj vel))) + (abs-vel-limit (fmin partial-velocity-limit (-> obj max-vel))) + ) + (if (< abs-vel-limit abs-vel) + (set! (-> obj vel) (* (-> obj vel) (/ abs-vel-limit abs-vel))) + ) + ) + ) (let ((dpos (* (-> obj vel) (-> *display* time-adjust-ratio)))) - (+! (-> obj value) dpos) - ) + (+! (-> obj value) dpos) + ) + 0 (none) ) (defmethod jump-to-target! cam-float-seeker ((obj cam-float-seeker) (arg0 float)) - "Jump to target + arg0 and set velocity to 0" (set! (-> obj value) (+ (-> obj target) arg0)) (let ((f0-2 0.0)) - (set! (-> obj vel) f0-2) - f0-2 - ) + (set! (-> obj vel) f0-2) + f0-2 + ) ) -;; very similar to cam-float-seeker but works on an -;; entire vector. (deftype cam-vector-seeker (structure) - ((target vector :inline :offset-assert 0) - (value vector :inline :offset-assert 16) - (vel vector :inline :offset-assert 32) - (accel float :offset-assert 48) - (max-vel float :offset-assert 52) - (max-partial float :offset-assert 56) + ((target vector :inline :offset-assert 0) + (value vector :inline :offset-assert 16) + (vel vector :inline :offset-assert 32) + (accel float :offset-assert 48) + (max-vel float :offset-assert 52) + (max-partial float :offset-assert 56) ) :method-count-assert 11 :size-assert #x3c :flag-assert #xb0000003c (:methods - (init! (_type_ vector float float float) none 9) - (update! (_type_ vector) none 10) - ) + (init! (_type_ vector float float float) none 9) + (update! (_type_ vector) none 10) + ) ) -(defmethod init! cam-vector-seeker ((obj cam-vector-seeker) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) + +(defmethod + init! + cam-vector-seeker + ((obj cam-vector-seeker) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) (cond - (arg0 - (set! (-> obj target quad) (-> arg0 quad)) - (set! (-> obj value quad) (-> arg0 quad)) - ) - (else - (vector-reset! (-> obj target)) - (vector-reset! (-> obj value)) - ) + (arg0 + (set! (-> obj target quad) (-> arg0 quad)) + (set! (-> obj value quad) (-> arg0 quad)) ) + (else + (vector-reset! (-> obj target)) + (vector-reset! (-> obj value)) + ) + ) (vector-reset! (-> obj vel)) (set! (-> obj accel) arg1) (set! (-> obj max-vel) arg2) @@ -267,42 +303,43 @@ (defmethod update! cam-vector-seeker ((obj cam-vector-seeker) (arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (cond - (arg0 - (vector+! gp-0 (-> obj target) arg0) - (vector-! gp-0 gp-0 (-> obj value)) - ) - (else - (vector-! gp-0 (-> obj target) (-> obj value)) - ) - ) - (let ((f30-1 (* (-> obj max-partial) (vector-length gp-0)))) - (vector-float*! - gp-0 - gp-0 - (* (-> obj accel) (-> *display* time-adjust-ratio)) - ) - (vector+! (-> obj vel) (-> obj vel) gp-0) - (let ((f0-4 (vector-length (-> obj vel))) - (f1-2 (fmin f30-1 (-> obj max-vel))) - ) - (if (< f1-2 f0-4) - (vector-float*! (-> obj vel) (-> obj vel) (/ f1-2 f0-4)) - ) - ) - ) - (vector-float*! gp-0 (-> obj vel) (-> *display* time-adjust-ratio)) - (vector+! (-> obj value) (-> obj value) gp-0) + 0.0 + (cond + (arg0 + (vector+! gp-0 (-> obj target) arg0) + (vector-! gp-0 gp-0 (-> obj value)) + ) + (else + (vector-! gp-0 (-> obj target) (-> obj value)) + ) ) + (let ((f30-1 (* (-> obj max-partial) (vector-length gp-0)))) + (vector-float*! + gp-0 + gp-0 + (* (-> obj accel) (-> *display* time-adjust-ratio)) + ) + (vector+! (-> obj vel) (-> obj vel) gp-0) + (let ((f0-4 (vector-length (-> obj vel))) + (f1-2 (fmin f30-1 (-> obj max-vel))) + ) + (if (< f1-2 f0-4) + (vector-float*! (-> obj vel) (-> obj vel) (/ f1-2 f0-4)) + ) + ) + ) + (vector-float*! gp-0 (-> obj vel) (-> *display* time-adjust-ratio)) + (vector+! (-> obj value) (-> obj value) gp-0) + ) 0 (none) ) (deftype cam-rotation-tracker (structure) - ((inv-mat matrix :inline :offset-assert 0) - (no-follow basic :offset-assert 64) - (follow-pt vector :inline :offset-assert 80) - (follow-off vector :inline :offset-assert 96) + ((inv-mat matrix :inline :offset-assert 0) + (no-follow basic :offset-assert 64) + (follow-pt vector :inline :offset-assert 80) + (follow-off vector :inline :offset-assert 96) (follow-blend float :offset-assert 112) (tilt-adjust cam-float-seeker :inline :offset-assert 116) (use-point-of-interest basic :offset-assert 140) @@ -315,7 +352,7 @@ :flag-assert #x9000000d0 ) -;; definition of type camera-combiner + (deftype camera-combiner (process) ((trans vector :inline :offset-assert 112) (inv-camera-rot matrix :inline :offset-assert 128) @@ -336,16 +373,16 @@ :flag-assert #xe017001e0 ) -;; definition of type camera-slave + (deftype camera-slave (process) - ((trans vector :score 999 :inline :offset-assert 112) + ((trans vector :inline :offset-assert 112) (fov float :offset-assert 128) (fov0 float :offset-assert 132) (fov1 float :offset-assert 136) (fov-index cam-index :inline :offset-assert 144) (tracking cam-rotation-tracker :inline :offset-assert 192) (view-off-param float :offset-assert 400) - (unknown-symbol symbol :offset 412) ;; from - cam-combiner::lambda2 - I'm convinced `camera-slave` is the only matching process in this case + (unknown-symbol symbol :offset 412) (view-off vector :inline :offset-assert 416) (min-z-override float :offset-assert 432) (view-flat vector :inline :offset-assert 448) @@ -358,11 +395,11 @@ (max-angle-offset float :offset-assert 2192) (max-angle-curr float :offset-assert 2196) (options uint32 :offset-assert 2200) - (cam-entity entity :offset-assert 2204) ; not totally confirmed yet, could be entity-actor + (cam-entity entity :offset-assert 2204) (velocity vector :inline :offset-assert 2208) (desired-pos vector :inline :offset-assert 2224) (time-dist-too-far uint32 :offset-assert 2240) - (los-state uint32 :offset-assert 2244) + (los-state slave-los-state :offset-assert 2244) (good-point vector :inline :offset-assert 2256) (los-tgt-spline-pt int32 :offset-assert 2272) (los-tgt-spline-pt-incarnation int32 :offset-assert 2276) @@ -394,68 +431,73 @@ :method-count-assert 14 :size-assert #xa04 :flag-assert #xe09a00a04 - ;; inherited inspect of process ) -;; definition of type camera-master + (deftype camera-master (process) - ((master-options uint32 :offset-assert 112) - (num-slaves int32 :offset-assert 116) - (slave (pointer camera-slave) 2 :offset-assert 120) - (slave-options uint32 :offset-assert 128) - (view-off-param-save float :offset-assert 132) - (changer uint32 :offset-assert 136) - (cam-entity entity :offset-assert 140) ; not totally confirmed yet - (stringMinLength float :offset-assert 144) - (stringMaxLength float :offset-assert 148) - (stringMinHeight float :offset-assert 152) - (stringMaxHeight float :offset-assert 156) - (string-min cam-vector-seeker :inline :offset-assert 160) - (string-max cam-vector-seeker :inline :offset-assert 224) - (string-push-z float :offset-assert 284) - (stringCliffHeight float :offset-assert 288) - (no-intro uint32 :offset-assert 292) - (force-blend uint32 :offset-assert 296) - (force-blend-time uint32 :offset-assert 300) - (local-down vector :inline :offset-assert 304) - (drawable-target handle :offset-assert 320) ; likely a `target`? - (which-bone int32 :offset-assert 328) - (pov-handle handle :offset-assert 336) - (pov-bone int32 :offset-assert 344) - (being-attacked symbol :offset-assert 348) - (attack-start uint64 :offset-assert 352) - (on-ground symbol :offset-assert 360) - (under-water int32 :offset-assert 364) - (on-pole symbol :offset-assert 368) - (tgt-rot-mat matrix :inline :offset-assert 384) - (tgt-face-mat matrix :inline :offset-assert 448) - (tpos-old vector :inline :offset-assert 512) - (tpos-curr vector :inline :offset-assert 528) - (target-height float :offset-assert 544) - (tpos-old-adj vector :inline :offset-assert 560) - (tpos-curr-adj vector :inline :offset-assert 576) - (tpos-tgt vector :inline :offset-assert 592) - (upspeed float :offset-assert 608) - (pitch-off vector :inline :offset-assert 624) - (foot-offset float :offset-assert 640) - (head-offset float :offset-assert 644) - (target-spline tracking-spline :inline :offset-assert 656) - (ease-from vector :inline :offset-assert 2304) - (ease-t float :offset-assert 2320) - (ease-step float :offset-assert 2324) - (ease-to vector :inline :offset-assert 2336) - (outro-curve curve :inline :offset-assert 2352) - (outro-t float :offset-assert 2372) - (outro-t-step float :offset-assert 2376) - (outro-exit-value float :offset-assert 2380) - (water-drip-time uint64 :offset-assert 2384) - (water-drip sparticle-launch-control :offset-assert 2392) - (water-drip-mult float :offset-assert 2396) - (water-drip-speed float :offset-assert 2400) + ((master-options uint32 :offset-assert 112) + (num-slaves int32 :offset-assert 116) + (slave (pointer camera-slave) 2 :offset-assert 120) + (slave-options uint32 :offset-assert 128) + (view-off-param-save float :offset-assert 132) + (changer uint32 :offset-assert 136) + (cam-entity entity :offset-assert 140) + (stringMinLength float :offset-assert 144) + (stringMaxLength float :offset-assert 148) + (stringMinHeight float :offset-assert 152) + (stringMaxHeight float :offset-assert 156) + (string-min cam-vector-seeker :inline :offset-assert 160) + (string-max cam-vector-seeker :inline :offset-assert 224) + (string-push-z float :offset-assert 284) + (stringCliffHeight float :offset-assert 288) + (no-intro uint32 :offset-assert 292) + (force-blend uint32 :offset-assert 296) + (force-blend-time uint32 :offset-assert 300) + (local-down vector :inline :offset-assert 304) + (drawable-target handle :offset-assert 320) + (which-bone int32 :offset-assert 328) + (pov-handle handle :offset-assert 336) + (pov-bone int32 :offset-assert 344) + (being-attacked symbol :offset-assert 348) + (attack-start uint64 :offset-assert 352) + (on-ground symbol :offset-assert 360) + (under-water int32 :offset-assert 364) + (on-pole symbol :offset-assert 368) + (tgt-rot-mat matrix :inline :offset-assert 384) + (tgt-face-mat matrix :inline :offset-assert 448) + (tpos-old vector :inline :offset-assert 512) + (tpos-curr vector :inline :offset-assert 528) + (target-height float :offset-assert 544) + (tpos-old-adj vector :inline :offset-assert 560) + (tpos-curr-adj vector :inline :offset-assert 576) + (tpos-tgt vector :inline :offset-assert 592) + (upspeed float :offset-assert 608) + (pitch-off vector :inline :offset-assert 624) + (foot-offset float :offset-assert 640) + (head-offset float :offset-assert 644) + (target-spline tracking-spline :inline :offset-assert 656) + (ease-from vector :inline :offset-assert 2304) + (ease-t float :offset-assert 2320) + (ease-step float :offset-assert 2324) + (ease-to vector :inline :offset-assert 2336) + (outro-curve curve :inline :offset-assert 2352) + (outro-t float :offset-assert 2372) + (outro-t-step float :offset-assert 2376) + (outro-exit-value float :offset-assert 2380) + (water-drip-time uint64 :offset-assert 2384) + (water-drip sparticle-launch-control :offset-assert 2392) + (water-drip-mult float :offset-assert 2396) + (water-drip-speed float :offset-assert 2400) ) :heap-base #x900 :method-count-assert 14 :size-assert #x964 :flag-assert #xe09000964 - ;; inherited inspect of process ) + + +0 + + + + diff --git a/goal_src/engine/camera/camera.gc b/goal_src/engine/camera/camera.gc index 031b30ab72..153ed359f0 100644 --- a/goal_src/engine/camera/camera.gc +++ b/goal_src/engine/camera/camera.gc @@ -371,7 +371,10 @@ (format (clear *cam-res-string*) "~S-flags" arg0) (set! (-> obj flags) - (the-as uint (cam-slave-get-flags arg1 (string->symbol *res-key-string*))) + (the-as + cam-index-options + (cam-slave-get-flags arg1 (string->symbol *res-key-string*)) + ) ) (let ((s3-2 (res-lump-data arg1 arg0 pointer)) (s0-1 (method-of-type res-lump get-property-struct)) @@ -441,7 +444,7 @@ (let ((s4-1 (new-stack-vector0))) 0.0 (cond - ((logtest? (-> obj flags) 2) + ((logtest? (-> obj flags) (cam-index-options SPHERICAL)) (vector-! s4-1 (-> obj vec 1) arg2) (set! (-> obj vec 1 w) (vector-length s4-1)) (vector-! s4-1 (the-as vector (-> obj vec)) arg2) @@ -449,7 +452,7 @@ (set! (-> obj vec 1 w) (- (-> obj vec 1 w) (-> obj vec 1 x))) (set! (-> obj vec 0 quad) (-> arg2 quad)) ) - ((logtest? (-> obj flags) 1) + ((logtest? (-> obj flags) (cam-index-options RADIAL)) (vector-! s4-1 (-> obj vec 1) arg2) (set! (-> obj vec 1 w) (vector-length s4-1)) (vector-! s4-1 (the-as vector (-> obj vec)) arg2) @@ -471,11 +474,11 @@ 0.0 (vector-! s5-0 arg0 (the-as vector (-> obj vec))) (cond - ((logtest? (-> obj flags) 2) + ((logtest? (-> obj flags) (cam-index-options SPHERICAL)) (vector-flatten! s5-0 s5-0 (-> *camera* local-down)) (/ (- (vector-length s5-0) (-> obj vec 1 x)) (-> obj vec 1 w)) ) - ((logtest? (-> obj flags) 1) + ((logtest? (-> obj flags) (cam-index-options RADIAL)) (/ (- (vector-length s5-0) (-> obj vec 1 x)) (-> obj vec 1 w)) ) (else @@ -907,11 +910,11 @@ ((< f26-0 0.0) (if (and *debug-segment* *display-camera-marks*) (camera-line-rel-len - (-> obj point s1-0) + (the-as vector (-> obj point s1-0)) s2-0 (* -40.96 f26-0) (the-as - rgba + vector4w (new 'static 'inline-array qword 1 (new 'static 'qword :data @@ -925,11 +928,11 @@ ) ((and *debug-segment* *display-camera-marks*) (camera-line-rel-len - (-> obj point s1-0) + (the-as vector (-> obj point s1-0)) s2-0 (* 40.96 f26-0) (the-as - rgba + vector4w (new 'static 'inline-array qword 1 (new 'static 'qword :data @@ -1133,7 +1136,7 @@ (set! (-> self intro-t) 1.0) (set! (-> self intro-t-step) 0.0) (set! (-> self spline-exists) #f) - (set! (-> self los-state) (the-as uint 0)) + (set! (-> self los-state) (slave-los-state none)) (set! (-> self enter-has-run) #f) (set! (-> self cam-entity) #f) (set! (-> self tracking no-follow) #f) diff --git a/goal_src/engine/game/main.gc b/goal_src/engine/game/main.gc index 717d493ba8..397c4ce501 100644 --- a/goal_src/engine/game/main.gc +++ b/goal_src/engine/game/main.gc @@ -322,9 +322,10 @@ ;; Cheat Codes ;;;;;;;;;;;;;;;;;;;;;; -(define *cheat-temp* (the-as (pointer int32) (malloc 'global 16))) +(define *cheat-temp* (the-as (pointer int32) (malloc 'global 20))) ;; 16 -> 20 (PAL) (define *master-exit* #f) (define *progress-cheat* #f) +(define *first-boot* #t) ;; PAL (defmacro cheats-sound-play (cheat?) "play the appropriate sound for inputting a cheat code" @@ -394,6 +395,29 @@ )) (cheats-sound-play *progress-cheat*) ) + + ;; added in PAL + (check-cheat-code (-> *cheat-temp* 4) 0 ;; they erroneously used (-> *cheat-temp* 5) here! + (triangle x circle square triangle x circle square) + (cpad-clear-buttons! 0 r1) + (set! *progress-cheat* (if *progress-cheat* + #f + 'camera + )) + (cond + (*cheat-mode* + (if (not *external-cam-mode*) + (external-cam-reset!) + ) + (set! *external-cam-mode* 'pad-1) + (sound-play-by-name (static-sound-name "select-menu") (new-sound-id) 1024 0 0 (the-as uint 1) (the-as vector #t)) + ) + (else + (set! *external-cam-mode* #f) + (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 (the-as uint 1) (the-as vector #t)) + ) + ) + ) ) ) @@ -643,7 +667,7 @@ (-> disp frames (-> disp on-screen) frame global-buf) )) (bucket-id debug-draw0)) - (if (= *master-mode* 'pause) + (if (and (= *master-mode* 'pause) (!= *cheat-mode* 'camera)) (draw-string-xy (lookup-text! *common-text* (game-text-id pause) #f) s3-1 256 160 (font-color orange-red) (font-flags shadow kerning middle large)) ) diff --git a/goal_src/engine/target/target-util.gc b/goal_src/engine/target/target-util.gc index 47b81950e8..37f7701950 100644 --- a/goal_src/engine/target/target-util.gc +++ b/goal_src/engine/target/target-util.gc @@ -11,6 +11,8 @@ ;; note: this file has a modification to let us run with an incompletely constructed target. ;; if you update the decompilation, you will need to restore this hack. +;; DECOMP BEGINS + (let ((v1-0 (new 'static 'skeleton-group @@ -67,13 +69,13 @@ (swim-jump-height-max meters :offset-assert 68) (tube-jump-height-min meters :offset-assert 72) (tube-jump-height-max meters :offset-assert 76) - (wheel-duration uint64 :offset-assert 80) - (wheel-jump-pre-window uint64 :offset-assert 88) - (wheel-jump-post-window uint64 :offset-assert 96) - (wheel-timeout uint64 :offset-assert 104) + (wheel-duration seconds :offset-assert 80) + (wheel-jump-pre-window seconds :offset-assert 88) + (wheel-jump-post-window seconds :offset-assert 96) + (wheel-timeout seconds :offset-assert 104) (wheel-speed-min meters :offset-assert 112) (wheel-speed-inc meters :offset-assert 116) - (wheel-flip-duration uint64 :offset-assert 120) + (wheel-flip-duration seconds :offset-assert 120) (wheel-flip-height meters :offset-assert 128) (wheel-flip-dist meters :offset-assert 132) (wheel-flip-art-height meters :offset-assert 136) @@ -81,13 +83,13 @@ (duck-slide-distance meters :offset-assert 144) (fall-far meters :offset-assert 148) (fall-far-inc meters :offset-assert 152) - (attack-timeout uint64 :offset-assert 160) - (ground-timeout uint64 :offset-assert 168) - (slide-down-timeout uint64 :offset-assert 176) - (fall-timeout uint64 :offset-assert 184) + (attack-timeout seconds :offset-assert 160) + (ground-timeout seconds :offset-assert 168) + (slide-down-timeout seconds :offset-assert 176) + (fall-timeout seconds :offset-assert 184) (fall-stumble-threshold meters :offset-assert 192) (yellow-projectile-speed meters :offset-assert 196) - (hit-invulnerable-timeout uint64 :offset-assert 200) + (hit-invulnerable-timeout seconds :offset-assert 200) (run-cycle-length float :offset-assert 208) (walk-cycle-dist meters :offset-assert 212) (walk-up-cycle-dist meters :offset-assert 216) @@ -129,7 +131,7 @@ (stuck-distance meters :offset-assert 576) (tongue-pull-speed-min float :offset-assert 580) (tongue-pull-speed-max float :offset-assert 584) - (yellow-attack-timeout uint64 :offset-assert 592) + (yellow-attack-timeout seconds :offset-assert 592) ) :method-count-assert 9 :size-assert #x258 @@ -159,12 +161,12 @@ :swim-jump-height-max (meters 5.0) :tube-jump-height-min (meters 1.75) :tube-jump-height-max (meters 2.5) - :wheel-duration #x96 - :wheel-jump-pre-window #x12c - :wheel-jump-post-window #x1e + :wheel-duration (seconds 0.5) + :wheel-jump-pre-window (seconds 1) + :wheel-jump-post-window (seconds 0.1) :wheel-speed-min (meters 11.5) :wheel-speed-inc (meters 1.5) - :wheel-flip-duration #xd2 + :wheel-flip-duration (seconds 0.7) :wheel-flip-height (meters 3.52) :wheel-flip-dist (meters 17.3) :wheel-flip-art-height (meters 3.2969) @@ -172,13 +174,13 @@ :duck-slide-distance (meters 5.75) :fall-far (meters 30.0) :fall-far-inc (meters 20.0) - :attack-timeout #x5a - :ground-timeout #x3c - :slide-down-timeout #x3c - :fall-timeout #x12c + :attack-timeout (seconds 0.3) + :ground-timeout (seconds 0.2) + :slide-down-timeout (seconds 0.2) + :fall-timeout (seconds 1) :fall-stumble-threshold (meters 39.9) :yellow-projectile-speed (meters 60.0) - :hit-invulnerable-timeout #x384 + :hit-invulnerable-timeout (seconds 3) :run-cycle-length 60.0 :walk-cycle-dist (meters 2.8) :walk-up-cycle-dist (meters 2.8) @@ -220,7 +222,7 @@ :stuck-distance (meters 0.05) :tongue-pull-speed-min 0.15 :tongue-pull-speed-max 0.22 - :yellow-attack-timeout #x3c + :yellow-attack-timeout (seconds 0.2) ) ) @@ -1188,7 +1190,7 @@ ) ) -(defun target-timed-invulnerable ((arg0 uint) (arg1 target)) +(defun target-timed-invulnerable ((arg0 seconds) (arg1 target)) (logior! (-> arg1 state-flags) 32) (set! (-> arg1 control unknown-dword70) (-> *display* base-frame-counter)) (set! (-> arg1 control unknown-dword71) (the-as int arg0)) diff --git a/goal_src/examples/debug-draw-example.gc b/goal_src/examples/debug-draw-example.gc index a52aeb38be..09b8ce54bd 100644 --- a/goal_src/examples/debug-draw-example.gc +++ b/goal_src/examples/debug-draw-example.gc @@ -124,10 +124,10 @@ ;; circle/square move camera relative x (left and right) (set! (-> local-trans x) (cond - ((logtest? (-> *cpad-list* cpads pad-idx button0-abs 0) (pad-buttons circle)) + ((cpad-hold? 0 circle) -80.0 ) - ((logtest? (-> *cpad-list* cpads pad-idx button0-abs 0) (pad-buttons square)) + ((cpad-hold? 0 square) 80.0 ) (else @@ -142,10 +142,10 @@ ;; in and out movement (set! (-> local-trans z) (cond - ((logtest? (-> *cpad-list* cpads pad-idx button0-abs 0) (pad-buttons down)) + ((cpad-hold? 0 down) -1600.0 ) - ((logtest? (-> *cpad-list* cpads pad-idx button0-abs 0) (pad-buttons up)) + ((cpad-hold? 0 up) 1600.0 ) (else @@ -161,7 +161,7 @@ ;; unused. (vector-negate! inv-cam-rot (-> trans rot)) ;; convert rotation to rotation matrix. - (matrix-rotate-zyx! cam-rot-mat (-> trans rot)) + (matrix-rotate-xyz! cam-rot-mat (-> trans rot)) ;; and rotate the translation. (vector-matrix*! local-trans local-trans cam-rot-mat) ) @@ -174,24 +174,24 @@ (set! (-> trans trans w) 1.0) ;; global translation - (if (logtest? (-> *cpad-list* cpads pad-idx button0-abs 0) (pad-buttons l1)) + (if (cpad-hold? 0 l1) (set! (-> trans trans y) (+ 2000.0 (-> trans trans y))) ) - (if (logtest? (-> *cpad-list* cpads pad-idx button0-abs 0) (pad-buttons r1)) + (if (cpad-hold? 0 r1) (set! (-> trans trans y) (+ -2000.0 (-> trans trans y))) ) ;; rotation (don't allow camera roll) - (if (logtest? (-> *cpad-list* cpads pad-idx button0-abs 0) (pad-buttons x)) + (if (cpad-hold? 0 x) (set! (-> trans rot x) (+ 54.13336 (-> trans rot x))) ) - (if (logtest? (-> *cpad-list* cpads pad-idx button0-abs 0) (pad-buttons triangle)) + (if (cpad-hold? 0 triangle) (set! (-> trans rot x) (+ -54.13336 (-> trans rot x))) ) - (if (logtest? (-> *cpad-list* cpads pad-idx button0-abs 0) (pad-buttons left)) + (if (cpad-hold? 0 left) (set! (-> trans rot y) (+ 150.13336 (-> trans rot y))) ) - (if (logtest? (-> *cpad-list* cpads pad-idx button0-abs 0) (pad-buttons right)) + (if (cpad-hold? 0 right) (set! (-> trans rot y) (+ -150.13336 (-> trans rot y))) ) diff --git a/goal_src/levels/finalboss/robotboss-weapon.gc b/goal_src/levels/finalboss/robotboss-weapon.gc index a8563f89c3..f9b9d52a8b 100644 --- a/goal_src/levels/finalboss/robotboss-weapon.gc +++ b/goal_src/levels/finalboss/robotboss-weapon.gc @@ -214,11 +214,7 @@ (set! (-> s5-0 quad) (-> self from quad)) (dotimes (s4-0 30) (arcing-shot-calculate gp-0 (* 0.033333335 (the float (+ s4-0 1)))) - (camera-line - gp-0 - s5-0 - (new 'static 'vector4w :data (new 'static 'array int32 4 #xff #xff 0 #x80)) - ) + (camera-line gp-0 s5-0 (new 'static 'vector4w :x #xff :y #xff :w #x80)) (set! (-> s5-0 quad) (-> gp-0 quad)) ) ) diff --git a/goal_src/levels/racer_common/racer-states-FIC-LAV-MIS-OGR-ROL.gc b/goal_src/levels/racer_common/racer-states-FIC-LAV-MIS-OGR-ROL.gc index 2be2ff3e76..61a9fbd100 100644 --- a/goal_src/levels/racer_common/racer-states-FIC-LAV-MIS-OGR-ROL.gc +++ b/goal_src/levels/racer_common/racer-states-FIC-LAV-MIS-OGR-ROL.gc @@ -9,7 +9,6 @@ ;; DECOMP BEGINS -;; failed to figure out what this is: (defstate target-racing-start (target) :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) @@ -461,9 +460,6 @@ (the-as (function none :behavior target) target-post) ) -;; definition for function target-racing-smack-check -;; INFO: Return type mismatch object vs none. -;; Used lq/sq (defbehavior target-racing-smack-check target () (if (and @@ -495,7 +491,6 @@ (none) ) -;; failed to figure out what this is: (defstate target-racing (target) :event (-> target-racing-start event) @@ -915,7 +910,6 @@ ) ) -;; failed to figure out what this is: (defstate target-racing-jump (target) :event (-> target-racing-start event) @@ -1199,7 +1193,6 @@ (-> target-racing post) ) -;; failed to figure out what this is: (defstate target-racing-bounce (target) :event (-> target-racing-start event) @@ -1405,7 +1398,6 @@ (-> target-racing post) ) -;; failed to figure out what this is: (defstate target-racing-smack (target) :event (-> target-racing-start event) @@ -1532,7 +1524,6 @@ (-> target-racing post) ) -;; failed to figure out what this is: (defstate target-racing-falling (target) :event (-> target-racing-start event) @@ -1572,7 +1563,6 @@ (-> target-racing post) ) -;; failed to figure out what this is: (defstate target-racing-hit (target) :event (the-as @@ -1745,7 +1735,6 @@ target-no-stick-post ) -;; failed to figure out what this is: (defstate target-racing-death (target) :event (-> target-death event) @@ -2226,7 +2215,6 @@ target-racing-post ) -;; failed to figure out what this is: (defstate target-racing-get-on (target) :event (the-as @@ -2566,7 +2554,6 @@ ) ) -;; failed to figure out what this is: (defstate target-racing-get-off (target) :event (the-as @@ -2666,7 +2653,6 @@ target-racing-post ) -;; failed to figure out what this is: (defstate target-racing-get-off-jump (target) :event (the-as @@ -2956,7 +2942,6 @@ ) ) -;; failed to figure out what this is: (defstate target-racing-get-off-hit-ground (target) :event (the-as @@ -3028,7 +3013,6 @@ ) ) -;; failed to figure out what this is: (defstate target-racing-grab (target) :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) @@ -3135,7 +3119,6 @@ target-racing-post ) -;; failed to figure out what this is: (defstate target-racing-clone-anim (target) :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) @@ -3199,3 +3182,7 @@ (none) ) ) + + + + diff --git a/test/decompiler/reference/engine/camera/cam-layout_REF.gc b/test/decompiler/reference/engine/camera/cam-layout_REF.gc index 3c12cd3256..f867366c3f 100644 --- a/test/decompiler/reference/engine/camera/cam-layout_REF.gc +++ b/test/decompiler/reference/engine/camera/cam-layout_REF.gc @@ -544,11 +544,7 @@ ) (else (let ((s5-0 (-> *volume-descriptor* pos-vol gp-0))) - (let - ((a0-7 - (new 'static 'vector4w :data (new 'static 'array int32 4 0 0 0 #x80)) - ) - ) + (let ((a0-7 (new 'static 'vector4w :w #x80))) (cond ((= (-> s5-0 volume-type) 'vol) (set! (-> a0-7 x) 0) @@ -568,7 +564,7 @@ 0 ) ) - (camera-line-setup (the-as vector a0-7)) + (camera-line-setup a0-7) ) (let ((s4-0 (the-as object (-> s5-0 first-point)))) (dotimes (s3-0 (/ (-> s5-0 point-count) 2)) @@ -700,7 +696,7 @@ (new 'static 'vector :y 1024.0) (new 'static 'vector :z 1024.0) gp-0 - (the-as vector (-> arg1 color)) + (-> arg1 color) (-> (new 'static 'array float 1 4096.0) 0) ) ) @@ -753,7 +749,7 @@ (new 'static 'vector :y 1024.0) (new 'static 'vector :z 1024.0) gp-0 - (the-as vector (-> arg1 color)) + (-> arg1 color) (-> (new 'static 'array float 1 4096.0) 0) ) ) @@ -783,10 +779,7 @@ (* 0.5 (cam-slave-get-fov arg0)) (-> (new 'static 'array float 1 0.75) 0) (-> (new 'static 'array float 1 1.0) 0) - (the-as - vector - (new 'static 'vector4w :data (new 'static 'array int32 4 0 0 #xff #x80)) - ) + (new 'static 'vector4w :z #xff :w #x80) ) ) ) @@ -803,10 +796,7 @@ (new 'static 'vector :y 1024.0) (new 'static 'vector :z 1024.0) s5-1 - (the-as - vector - (new 'static 'vector4w :data (new 'static 'array int32 4 #x80 0 0 #x80)) - ) + (new 'static 'vector4w :x #x80 :w #x80) (-> (new 'static 'array float 1 4096.0) 0) ) ) @@ -824,10 +814,7 @@ (new 'static 'vector :y 1024.0) (new 'static 'vector :z 1024.0) s5-2 - (the-as - vector - (new 'static 'vector4w :data (new 'static 'array int32 4 0 #x80 0 #x80)) - ) + (new 'static 'vector4w :y #x80 :w #x80) (-> (new 'static 'array float 1 4096.0) 0) ) ) @@ -845,13 +832,7 @@ (new 'static 'vector :y 1024.0) (new 'static 'vector :z 1024.0) s5-3 - (the-as - vector - (new 'static 'vector4w - :data - (new 'static 'array int32 4 #x80 0 #x80 #x80) - ) - ) + (new 'static 'vector4w :x #x80 :z #x80 :w #x80) (-> (new 'static 'array float 1 4096.0) 0) ) ) @@ -868,7 +849,7 @@ s3-1 'campath 'campath-k - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) ) (or (!= *camera-layout-blink* 'spline) @@ -890,7 +871,7 @@ arg0 'spline-offset 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) s4-1 (the-as (pointer res-tag) #f) *res-static-buf* @@ -911,14 +892,7 @@ s3-1 ) (vector+! s5-4 s5-4 s4-1) - (camera-line - s2-0 - s5-4 - (new 'static 'vector4w - :data - (new 'static 'array int32 4 #xff #xff 0 #x80) - ) - ) + (camera-line s2-0 s5-4 (new 'static 'vector4w :x #xff :y #xff :w #x80)) ) (curve-get-pos! s5-4 (-> *CAM_LAYOUT-bank* spline-t) s3-1) (vector+! s5-4 s5-4 s4-1) @@ -926,13 +900,7 @@ (new 'static 'vector :y 1024.0) (new 'static 'vector :z 1024.0) s5-4 - (the-as - vector - (new 'static 'vector4w - :data - (new 'static 'array int32 4 #xff #xff 0 #x80) - ) - ) + (new 'static 'vector4w :x #xff :y #xff :w #x80) (-> (new 'static 'array float 1 4096.0) 0) ) ) @@ -945,13 +913,7 @@ ) (when (and - (get-curve-data! - arg0 - s3-2 - 'intro - 'intro-k - (-> (new 'static 'array float 1 -1000000000.0) 0) - ) + (get-curve-data! arg0 s3-2 'intro 'intro-k (the-as float -1000000000.0)) (or (!= *camera-layout-blink* 'intro) (logtest? (-> *display* real-actual-frame-counter) 8) @@ -967,7 +929,7 @@ s1-2 'campath 'campath-k - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) ) (curve-get-pos! s4-2 (-> (new 'static 'array float 1 0.0) 0) s1-2) (curve-get-pos! s5-5 (-> (new 'static 'array float 1 1.0) 0) s3-2) @@ -988,11 +950,7 @@ s3-2 ) (vector+! s5-5 s5-5 s4-2) - (camera-line - s2-1 - s5-5 - (new 'static 'vector4w :data (new 'static 'array int32 4 0 0 #xff #x80)) - ) + (camera-line s2-1 s5-5 (new 'static 'vector4w :z #xff :w #x80)) ) (curve-get-pos! s5-5 (-> *CAM_LAYOUT-bank* intro-t) s3-2) (vector+! s5-5 s5-5 s4-2) @@ -1000,10 +958,7 @@ (new 'static 'vector :y 1024.0) (new 'static 'vector :z 1024.0) s5-5 - (the-as - vector - (new 'static 'vector4w :data (new 'static 'array int32 4 0 0 #xff #x80)) - ) + (new 'static 'vector4w :z #xff :w #x80) (-> (new 'static 'array float 1 4096.0) 0) ) (curve-get-pos! @@ -1020,10 +975,7 @@ (new 'static 'vector :y 1024.0) (new 'static 'vector :z 1024.0) s5-5 - (the-as - vector - (new 'static 'vector4w :data (new 'static 'array int32 4 0 0 #xff #x80)) - ) + (new 'static 'vector4w :z #xff :w #x80) (-> (new 'static 'array float 1 4096.0) 0) ) ) @@ -1044,7 +996,7 @@ 'campoints-offset structure :time - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) ) ) (s4-3 (new 'stack-no-clear 'vector)) @@ -1069,23 +1021,13 @@ (set! (-> s3-3 quad) (-> (the-as (pointer uint128) (&+ s2-3 16)))) ) ) - (camera-line - s4-3 - s3-3 - (new 'static 'vector4w :data (new 'static 'array int32 4 0 #x80 0 #x80)) - ) + (camera-line s4-3 s3-3 (new 'static 'vector4w :y #x80 :w #x80)) (vector-lerp-clamp! s5-6 s4-3 s3-3 (-> *CAM_LAYOUT-bank* spline-t)) (camera-cross (new 'static 'vector :y 1024.0) (new 'static 'vector :z 1024.0) s5-6 - (the-as - vector - (new 'static 'vector4w - :data - (new 'static 'array int32 4 #xff #xff 0 #x80) - ) - ) + (new 'static 'vector4w :x #xff :y #xff :w #x80) (-> (new 'static 'array float 1 4096.0) 0) ) ) @@ -1113,7 +1055,7 @@ (camera-line (the-as vector (&+ s4-4 0)) (the-as vector (&+ s4-4 16)) - (new 'static 'vector4w :data (new 'static 'array int32 4 0 #xff #xff #x80)) + (new 'static 'vector4w :y #xff :z #xff :w #x80) ) (vector-lerp-clamp! s5-7 @@ -1125,13 +1067,7 @@ (new 'static 'vector :y 1024.0) (new 'static 'vector :z 1024.0) s5-7 - (the-as - vector - (new 'static 'vector4w - :data - (new 'static 'array int32 4 0 #xff #xff #x80) - ) - ) + (new 'static 'vector4w :y #xff :z #xff :w #x80) (-> (new 'static 'array float 1 4096.0) 0) ) ) @@ -1148,18 +1084,12 @@ (camera-line (-> s5-8 from) (-> s5-8 origin) - (new 'static 'vector4w - :data - (new 'static 'array int32 4 #x80 #x80 #x80 #x80) - ) + (new 'static 'vector4w :x #x80 :y #x80 :z #x80 :w #x80) ) (camera-line (-> s5-8 to) (-> s5-8 origin) - (new 'static 'vector4w - :data - (new 'static 'array int32 4 #x80 #x80 #x80 #x80) - ) + (new 'static 'vector4w :x #x80 :y #x80 :z #x80 :w #x80) ) (vector-! (-> s5-8 from) (-> s5-8 from) (-> s5-8 origin)) (vector-! (-> s5-8 to) (-> s5-8 to) (-> s5-8 origin)) @@ -1169,10 +1099,7 @@ (camera-line (-> s5-8 origin) s4-5 - (new 'static 'vector4w - :data - (new 'static 'array int32 4 #x80 #x80 #x80 #x80) - ) + (new 'static 'vector4w :x #x80 :y #x80 :z #x80 :w #x80) ) (when (not (paused?)) (+! (-> *CAM_LAYOUT-bank* debug-t) (-> *CAM_LAYOUT-bank* debug-step)) @@ -1183,10 +1110,7 @@ ) (set! (-> s5-8 axis) #f) (set! (-> s5-8 disp) "li") - (set! - (-> s5-8 color) - (new 'static 'vector4w :data (new 'static 'array int32 4 #xff 0 0 #x80)) - ) + (set! (-> s5-8 color) (new 'static 'vector4w :x #xff :w #x80)) (interp-test (the-as (function vector vector vector float vector float none) @@ -1195,47 +1119,32 @@ s5-8 ) (set! (-> s5-8 disp) "si") - (set! - (-> s5-8 color) - (new 'static 'vector4w :data (new 'static 'array int32 4 0 #xff 0 #x80)) - ) + (set! (-> s5-8 color) (new 'static 'vector4w :y #xff :w #x80)) (interp-test (the-as (function vector vector vector float vector float none) v-slrp!) s5-8 ) (set! (-> s5-8 disp) "si2") - (set! - (-> s5-8 color) - (new 'static 'vector4w :data (new 'static 'array int32 4 0 0 #xff #x80)) - ) + (set! (-> s5-8 color) (new 'static 'vector4w :z #xff :w #x80)) (interp-test (the-as (function vector vector vector float vector float none) v-slrp2!) s5-8 ) (set! (-> s5-8 disp) "si3") - (set! - (-> s5-8 color) - (new 'static 'vector4w :data (new 'static 'array int32 4 #xff 0 #xff #x80)) - ) + (set! (-> s5-8 color) (new 'static 'vector4w :x #xff :z #xff :w #x80)) (interp-test-deg (the-as (function vector vector vector vector float none) v-slrp3!) s5-8 ) (set! (-> s5-8 axis) (-> *camera* local-down)) (set! (-> s5-8 disp) "si2d") - (set! - (-> s5-8 color) - (new 'static 'vector4w :data (new 'static 'array int32 4 0 #xff #xff #x80)) - ) + (set! (-> s5-8 color) (new 'static 'vector4w :y #xff :z #xff :w #x80)) (interp-test (the-as (function vector vector vector float vector float none) v-slrp2!) s5-8 ) (set! (-> s5-8 disp) "si3d") - (set! - (-> s5-8 color) - (new 'static 'vector4w :data (new 'static 'array int32 4 #xff #xff 0 #x80)) - ) + (set! (-> s5-8 color) (new 'static 'vector4w :x #xff :y #xff :w #x80)) (interp-test-deg (the-as (function vector vector vector vector float none) v-slrp3!) s5-8 @@ -1432,7 +1341,7 @@ arg0 structure :time - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) ) ) (add-data! @@ -1454,7 +1363,7 @@ arg0 structure :time - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) ) ) (when @@ -1482,7 +1391,7 @@ arg1 structure :time - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) ) ) (add-data! @@ -1507,7 +1416,7 @@ arg1 structure :time - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) ) ) (when @@ -1534,7 +1443,7 @@ (the-as vector s3-1) (the-as vector s3-1) s4-0 - (-> (new 'static 'array float 1 409.6) 0) + (the-as float 409.6) ) (cond ((not arg1) @@ -1718,7 +1627,7 @@ ;; definition for function clmf-to-edit (defbehavior clmf-to-edit cam-layout () - (set! (-> self res-key) (-> (new 'static 'array float 1 -1000000000.0) 0)) + (set! (-> self res-key) -1000000000.0) (set! *clm* *clm-edit*) #t ) @@ -1767,7 +1676,7 @@ 'rot-offset vector :time - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) ) ) ) @@ -1818,14 +1727,17 @@ (format (clear *res-key-string*) "~S~S" 'trans '-offset) (let ((s5-1 - (s5-0 - s2-0 - (string->symbol *res-key-string*) - 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) - #f - (the-as (pointer res-tag) #f) - *res-static-buf* + (the-as + vector + (s5-0 + s2-0 + (string->symbol *res-key-string*) + 'interp + (the-as float -1000000000.0) + #f + (the-as (pointer res-tag) #f) + *res-static-buf* + ) ) ) ) @@ -1834,9 +1746,9 @@ (res-lump-struct arg2 'translation_info - structure + vector :time - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) ) ) (s3-1 (new-stack-vector0)) @@ -1851,33 +1763,33 @@ ) ) (set! (-> s3-1 quad) (-> s1-0 quad)) - (when s5-1 + (when (the-as structure s5-1) (if arg0 (format #t "offset ~M ~M ~M (added)~%" - (-> (the-as vector s5-1) x) - (-> (the-as vector s5-1) y) - (-> (the-as vector s5-1) z) + (-> s5-1 x) + (-> s5-1 y) + (-> s5-1 z) ) ) - (vector+! s3-1 s3-1 (the-as vector s5-1)) + (vector+! s3-1 s3-1 s5-1) ) - (when (the-as vector s2-1) + (when s2-1 (if arg0 (format #t "level-trans ~M ~M ~M (subtracted)~%" - (-> (the-as vector s2-1) x) - (-> (the-as vector s2-1) y) - (-> (the-as vector s2-1) z) + (-> s2-1 x) + (-> s2-1 y) + (-> s2-1 z) ) ) - (vector-! s3-1 s3-1 (the-as vector s2-1)) + (vector-! s3-1 s3-1 s2-1) ) - (set! s2-1 (or (the-as vector s5-1) s2-1)) - (set! arg0 (and (the-as vector s2-1) arg0)) - (if (the-as structure arg0) + (set! s2-1 (the-as vector (or s5-1 s2-1))) + (set! arg0 (and (the-as symbol s2-1) arg0)) + (if arg0 (format #t "final trans ~M ~M ~M (maya)~%" @@ -1887,13 +1799,13 @@ ) ) ) - (the-as string (if (the-as vector s5-1) + (the-as string (if s5-1 (format arg1 " tag trans-offset METERS(~M) METERS(~M) METERS(~M) 1.0 // vector~%" - (-> (the-as vector s5-1) x) - (-> (the-as vector s5-1) y) - (-> (the-as vector s5-1) z) + (-> s5-1 x) + (-> s5-1 y) + (-> s5-1 z) ) ) ) @@ -1907,13 +1819,7 @@ (defun cam-layout-save-pivot ((arg0 symbol) (arg1 string) (arg2 entity-actor)) (let ((s2-0 - (res-lump-struct - arg2 - 'pivot - vector - :time - (-> (new 'static 'array float 1 -1000000000.0) 0) - ) + (res-lump-struct arg2 'pivot vector :time (the-as float -1000000000.0)) ) (s3-0 (method-of-type res-lump get-property-struct)) ) @@ -1926,7 +1832,7 @@ arg2 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) #f (the-as (pointer res-tag) #f) *res-static-buf* @@ -1986,13 +1892,7 @@ (defun cam-layout-save-align ((arg0 symbol) (arg1 string) (arg2 entity-actor)) (let ((s2-0 - (res-lump-struct - arg2 - 'align - vector - :time - (-> (new 'static 'array float 1 -1000000000.0) 0) - ) + (res-lump-struct arg2 'align vector :time (the-as float -1000000000.0)) ) (s3-0 (method-of-type res-lump get-property-struct)) ) @@ -2005,7 +1905,7 @@ arg2 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) #f (the-as (pointer res-tag) #f) *res-static-buf* @@ -2072,7 +1972,7 @@ 'interesting vector :time - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) ) ) (s3-0 (method-of-type res-lump get-property-struct)) @@ -2086,7 +1986,7 @@ arg2 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) #f (the-as (pointer res-tag) #f) *res-static-buf* @@ -2149,7 +2049,7 @@ arg2 'fov 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2164,7 +2064,7 @@ arg2 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2214,7 +2114,7 @@ arg2 'focalPull 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2229,7 +2129,7 @@ arg2 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2265,13 +2165,7 @@ (defun cam-layout-save-flags ((arg0 symbol) (arg1 string) (arg2 entity-actor)) (let ((s4-0 - (res-lump-value - arg2 - 'flags - uint128 - :time - (-> (new 'static 'array float 1 -1000000000.0) 0) - ) + (res-lump-value arg2 'flags uint128 :time (the-as float -1000000000.0)) ) (s5-0 (method-of-type res-lump get-property-value)) (s1-0 arg2) @@ -2283,7 +2177,7 @@ s1-0 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (the-as uint128 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2298,7 +2192,7 @@ arg2 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (the-as uint128 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2307,17 +2201,17 @@ ) (when arg0 (format #t "setup flags ") - (cam-slave-options->string (the-as uint s4-0) (the-as string #t)) + (cam-slave-options->string (the-as cam-slave-options s4-0) #t) (format #t "~%") (format #t "forced on ") - (cam-slave-options->string (the-as uint s5-1) (the-as string #t)) + (cam-slave-options->string (the-as cam-slave-options s5-1) #t) (format #t "~%") (format #t "forced off ") - (cam-slave-options->string (the-as uint s3-1) (the-as string #t)) + (cam-slave-options->string (the-as cam-slave-options s3-1) #t) (format #t "~%") (let ((s4-1 (logclear (logior s4-0 s5-1) s3-1))) (format #t "final ") - (cam-slave-options->string (the-as uint s4-1) (the-as string #t)) + (cam-slave-options->string (the-as cam-slave-options s4-1) #t) ) (format #t "~%") ) @@ -2351,7 +2245,7 @@ 'focalpull-flags uint128 :time - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) ) ) (s5-0 (method-of-type res-lump get-property-value)) @@ -2364,7 +2258,7 @@ s1-0 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (the-as uint128 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2379,7 +2273,7 @@ arg2 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (the-as uint128 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2388,17 +2282,17 @@ ) (when arg0 (format #t "setup focalpull-flags ") - (cam-index-options->string (the-as uint s4-0) (the-as string #t)) + (cam-index-options->string (the-as cam-index-options s4-0) #t) (format #t "~%") (format #t "forced on ") - (cam-index-options->string (the-as uint s5-1) (the-as string #t)) + (cam-index-options->string (the-as cam-index-options s5-1) #t) (format #t "~%") (format #t "forced off ") - (cam-index-options->string (the-as uint s3-1) (the-as string #t)) + (cam-index-options->string (the-as cam-index-options s3-1) #t) (format #t "~%") (let ((s4-1 (logclear (logior s4-0 s5-1) s3-1))) (format #t "final ") - (cam-index-options->string (the-as uint s4-1) (the-as string #t)) + (cam-index-options->string (the-as cam-index-options s4-1) #t) ) (format #t "~%") ) @@ -2432,7 +2326,7 @@ 'campoints-flags uint128 :time - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) ) ) (s5-0 (method-of-type res-lump get-property-value)) @@ -2445,7 +2339,7 @@ s1-0 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (the-as uint128 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2460,7 +2354,7 @@ arg2 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (the-as uint128 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2469,17 +2363,17 @@ ) (when arg0 (format #t "setup campoints-flags ") - (cam-index-options->string (the-as uint s4-0) (the-as string #t)) + (cam-index-options->string (the-as cam-index-options s4-0) #t) (format #t "~%") (format #t "forced on ") - (cam-index-options->string (the-as uint s5-1) (the-as string #t)) + (cam-index-options->string (the-as cam-index-options s5-1) #t) (format #t "~%") (format #t "forced off ") - (cam-index-options->string (the-as uint s3-1) (the-as string #t)) + (cam-index-options->string (the-as cam-index-options s3-1) #t) (format #t "~%") (let ((s4-1 (logclear (logior s4-0 s5-1) s3-1))) (format #t "final ") - (cam-index-options->string (the-as uint s4-1) (the-as string #t)) + (cam-index-options->string (the-as cam-index-options s4-1) #t) ) (format #t "~%") ) @@ -2512,7 +2406,7 @@ arg2 'intro-time 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2527,7 +2421,7 @@ arg2 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2572,7 +2466,7 @@ arg2 'intro-exitValue 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2587,7 +2481,7 @@ arg2 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2627,7 +2521,7 @@ arg2 'interpTime 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2642,7 +2536,7 @@ arg2 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2678,20 +2572,14 @@ (when (and (not - (res-lump-struct - arg2 - 'pivot - structure - :time - (-> (new 'static 'array float 1 -1000000000.0) 0) - ) + (res-lump-struct arg2 'pivot structure :time (the-as float -1000000000.0)) ) (res-lump-struct arg2 'spline-offset structure :time - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) ) ) (let @@ -2701,7 +2589,7 @@ 'spline-offset vector :time - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) ) ) ) @@ -2738,19 +2626,13 @@ (when (and (not - (res-lump-struct - arg2 - 'pivot - structure - :time - (-> (new 'static 'array float 1 -1000000000.0) 0) - ) + (res-lump-struct arg2 'pivot structure :time (the-as float -1000000000.0)) ) ((method-of-type res-lump get-property-value-float) arg2 'spline-follow-dist-offset 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (the-as float #f) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2762,7 +2644,7 @@ arg2 'spline-follow-dist-offset 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2796,7 +2678,7 @@ 'campoints-offset vector :time - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) ) ) ) @@ -2833,7 +2715,7 @@ arg2 'tiltAdjust 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2848,7 +2730,7 @@ arg2 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2885,7 +2767,7 @@ arg2 'stringMinLength 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2900,7 +2782,7 @@ arg2 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2937,7 +2819,7 @@ arg2 'stringMaxLength 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2952,7 +2834,7 @@ arg2 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -2989,7 +2871,7 @@ arg2 'stringMinHeight 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -3004,7 +2886,7 @@ arg2 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -3041,7 +2923,7 @@ arg2 'stringMaxHeight 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -3056,7 +2938,7 @@ arg2 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -3093,7 +2975,7 @@ arg2 'stringCliffHeight 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -3108,7 +2990,7 @@ arg2 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -3143,7 +3025,7 @@ arg2 'maxAngle 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -3158,7 +3040,7 @@ arg2 (string->symbol *res-key-string*) 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -3193,13 +3075,7 @@ (format *temp-string* "dd_next/caminfo/~s.cam" - (res-lump-struct - arg0 - 'name - structure - :time - (-> (new 'static 'array float 1 -1000000000.0) 0) - ) + (res-lump-struct arg0 'name structure :time (the-as float -1000000000.0)) ) (format *temp-string* "dd_next/caminfo/garbage") ) @@ -3208,26 +3084,14 @@ (format #t "---------camera '~S'------------~%" - (res-lump-struct - arg0 - 'name - structure - :time - (-> (new 'static 'array float 1 -1000000000.0) 0) - ) + (res-lump-struct arg0 'name structure :time (the-as float -1000000000.0)) ) ) (format s4-2 "#include /next/config_data/standard.m2d~%") (format s4-2 "camera ~s {~%" - (res-lump-struct - arg0 - 'name - structure - :time - (-> (new 'static 'array float 1 -1000000000.0) 0) - ) + (res-lump-struct arg0 'name structure :time (the-as float -1000000000.0)) ) (cam-layout-save-cam-rot arg1 @@ -3354,7 +3218,7 @@ 'name structure :time - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) ) ) ) @@ -3682,7 +3546,7 @@ (-> self cam-entity) arg0 'interp - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) (-> (new 'static 'array float 1 0.0) 0) (the-as (pointer res-tag) #f) *res-static-buf* @@ -3803,7 +3667,7 @@ :tag-ptr (& sv-16) :time - (-> (new 'static 'array float 1 -1000000000.0) 0) + (the-as float -1000000000.0) ) ) ) @@ -5117,13 +4981,7 @@ (format *temp-string* "\"~S\"~%" - (res-lump-struct - s3-0 - 'name - structure - :time - (-> (new 'static 'array float 1 -1000000000.0) 0) - ) + (res-lump-struct s3-0 'name structure :time (the-as float -1000000000.0)) ) ) ) @@ -5303,7 +5161,7 @@ ;; definition for function cam-layout-init ;; INFO: Return type mismatch object vs none. (defbehavior cam-layout-init cam-layout () - (set! (-> self res-key) (-> (new 'static 'array float 1 -1000000000.0) 0)) + (set! (-> self res-key) -1000000000.0) (set! (-> self num-entities) 0) (let ((v1-2 (-> *camera-engine* alive-list next0))) *camera-engine* diff --git a/test/decompiler/reference/engine/camera/cam-states_REF.gc b/test/decompiler/reference/engine/camera/cam-states_REF.gc index e416ae7f9f..72286b6943 100644 --- a/test/decompiler/reference/engine/camera/cam-states_REF.gc +++ b/test/decompiler/reference/engine/camera/cam-states_REF.gc @@ -2239,13 +2239,13 @@ (set! f30-0 (fmin f30-0 (- (-> arg0 next-normal w)))) ) (cond - ((= (-> self los-state) 2) + ((= (-> self los-state) (slave-los-state ccw)) (if *display-cam-los-debug* (format *stdcon* "straddle stick ccw~%") ) (vector-normalize! arg1 (+ f28-0 (-> *CAM_STRING-bank* los-coll-rad))) ) - ((= (-> self los-state) 1) + ((= (-> self los-state) (slave-los-state cw)) (if *display-cam-los-debug* (format *stdcon* "straddle stick cw~%") ) @@ -2296,7 +2296,7 @@ (if *display-cam-los-debug* (format *stdcon* "straddle diagonal ccw~%") ) - (set! (-> self los-state) (the-as uint 2)) + (set! (-> self los-state) (slave-los-state ccw)) (vector-normalize! arg1 (+ f28-0 (-> *CAM_STRING-bank* los-coll-rad))) ) ((and @@ -2342,21 +2342,21 @@ (if *display-cam-los-debug* (format *stdcon* "straddle diagonal cw~%") ) - (set! (-> self los-state) (the-as uint 1)) + (set! (-> self los-state) (slave-los-state cw)) (vector-normalize! arg1 (- f30-0 (-> *CAM_STRING-bank* los-coll-rad))) ) ((< f28-0 (- f30-0)) (if *display-cam-los-debug* (format *stdcon* "straddle ccw~%") ) - (set! (-> self los-state) (the-as uint 2)) + (set! (-> self los-state) (slave-los-state ccw)) (vector-normalize! arg1 (+ f28-0 (-> *CAM_STRING-bank* los-coll-rad))) ) (else (if *display-cam-los-debug* (format *stdcon* "straddle cw~%") ) - (set! (-> self los-state) (the-as uint 1)) + (set! (-> self los-state) (slave-los-state cw)) (vector-normalize! arg1 (- f30-0 (-> *CAM_STRING-bank* los-coll-rad))) ) ) @@ -2375,7 +2375,7 @@ (if *display-cam-los-debug* (format *stdcon* "diagonal ccw~%") ) - (set! (-> self los-state) (the-as uint 2)) + (set! (-> self los-state) (slave-los-state ccw)) (vector-normalize! arg1 (- (-> *CAM_STRING-bank* los-coll-rad) (-> arg0 next-normal z)) @@ -2394,7 +2394,7 @@ (if *display-cam-los-debug* (format *stdcon* "diagonal cw~%") ) - (set! (-> self los-state) (the-as uint 1)) + (set! (-> self los-state) (slave-los-state cw)) (vector-normalize! arg1 (- (-> arg0 intersection z) (-> *CAM_STRING-bank* los-coll-rad)) @@ -2404,14 +2404,14 @@ (dist-info-valid? (the-as collide-los-dist-info (-> arg0 intersection))) (dist-info-valid? (the-as collide-los-dist-info (-> arg0 next-normal))) ) - (set! (-> self los-state) (the-as uint 3)) + (set! (-> self los-state) (slave-los-state between)) (vector-normalize! arg1 (the-as float 0.0001)) ) ((dist-info-valid? (the-as collide-los-dist-info (-> arg0 intersection))) (if *display-cam-los-debug* (format *stdcon* "regular cw~%") ) - (set! (-> self los-state) (the-as uint 1)) + (set! (-> self los-state) (slave-los-state cw)) (vector-normalize! arg1 (- (-> arg0 intersection z) (-> *CAM_STRING-bank* los-coll-rad)) @@ -2421,14 +2421,14 @@ (if *display-cam-los-debug* (format *stdcon* "regular ccw~%") ) - (set! (-> self los-state) (the-as uint 2)) + (set! (-> self los-state) (slave-los-state ccw)) (vector-normalize! arg1 (- (-> *CAM_STRING-bank* los-coll-rad) (-> arg0 next-normal z)) ) ) (else - (set! (-> self los-state) (the-as uint 0)) + (set! (-> self los-state) (slave-los-state none)) (vector-reset! arg1) ) ) @@ -2956,9 +2956,15 @@ ) ((= (-> self string-vel-dir) 5) ) - ((and (= (-> self string-vel-dir) 2) (= (-> self los-state) 1)) + ((and + (= (-> self string-vel-dir) 2) + (= (-> self los-state) (slave-los-state cw)) + ) ) - ((and (= (-> self string-vel-dir) 1) (= (-> self los-state) 2)) + ((and + (= (-> self string-vel-dir) 1) + (= (-> self los-state) (slave-los-state ccw)) + ) ) ) (when *display-cam-los-debug* @@ -3072,7 +3078,10 @@ ) ((and (< f30-0 f28-0) - (or (= (-> self los-state) 2) (= (-> self los-state) 1)) + (or + (= (-> self los-state) (slave-los-state ccw)) + (= (-> self los-state) (slave-los-state cw)) + ) ) (vector-normalize! (-> self view-flat) f30-0) ) @@ -3106,7 +3115,11 @@ (vector-! s5-0 s5-0 (-> self string-trans)) (cam-los-collide (-> self string-trans) s5-0 gp-0 4098) (when (-> gp-0 vert-next y) - (when (or (= (-> self los-state) 2) (= (-> self los-state) 1)) + (when + (or + (= (-> self los-state) (slave-los-state ccw)) + (= (-> self los-state) (slave-los-state cw)) + ) (let ((a0-6 (new 'stack-no-clear 'vector))) (vector-! a0-6 (-> *camera* tpos-curr) (-> *camera* tpos-old)) (if @@ -3271,7 +3284,10 @@ ) ((and (< 0.0 f28-0) - (or (= (-> self los-state) 2) (= (-> self los-state) 1)) + (or + (= (-> self los-state) (slave-los-state ccw)) + (= (-> self los-state) (slave-los-state cw)) + ) ) ) ((< (* 0.05 (- 1.0 f0-16)) f28-0) @@ -3341,7 +3357,7 @@ ) ) (cond - ((and (= (-> self los-state) 2) (< 0.0 f0-29)) + ((and (= (-> self los-state) (slave-los-state ccw)) (< 0.0 f0-29)) (let ((f0-34 (fmax @@ -3360,7 +3376,7 @@ ) ) ) - ((and (= (-> self los-state) 1) (< f0-29 0.0)) + ((and (= (-> self los-state) (slave-los-state cw)) (< f0-29 0.0)) (let ((f0-40 (fmax diff --git a/test/decompiler/reference/engine/camera/camera-h_REF.gc b/test/decompiler/reference/engine/camera/camera-h_REF.gc index da126ddb26..aa50d85ed8 100644 --- a/test/decompiler/reference/engine/camera/camera-h_REF.gc +++ b/test/decompiler/reference/engine/camera/camera-h_REF.gc @@ -6,7 +6,7 @@ ((collide-move-rad float :offset-assert 4) (joypad uint32 :offset-assert 8) (min-detectable-velocity float :offset-assert 12) - (attack-timeout uint64 :offset-assert 16) + (attack-timeout seconds :offset-assert 16) (default-string-max-y meters :offset-assert 24) (default-string-min-y meters :offset-assert 28) (default-string-max-z meters :offset-assert 32) @@ -61,7 +61,7 @@ (new 'static 'camera-bank :collide-move-rad 1638.4 :min-detectable-velocity 40.96 - :attack-timeout #x4b + :attack-timeout (seconds 0.25) :default-string-max-y (meters 3.0) :default-string-min-y (meters 1.0) :default-string-max-z (meters 12.5) @@ -73,8 +73,8 @@ ;; definition of type cam-index (deftype cam-index (structure) - ((flags uint32 :offset-assert 0) - (vec vector 2 :inline :offset 16) + ((flags cam-index-options :offset-assert 0) + (vec vector 2 :inline :offset 16) ) :method-count-assert 11 :size-assert #x30 @@ -507,7 +507,7 @@ (velocity vector :inline :offset-assert 2208) (desired-pos vector :inline :offset-assert 2224) (time-dist-too-far uint32 :offset-assert 2240) - (los-state uint32 :offset-assert 2244) + (los-state slave-los-state :offset-assert 2244) (good-point vector :inline :offset-assert 2256) (los-tgt-spline-pt int32 :offset-assert 2272) (los-tgt-spline-pt-incarnation int32 :offset-assert 2276) diff --git a/test/decompiler/reference/engine/camera/camera_REF.gc b/test/decompiler/reference/engine/camera/camera_REF.gc index 3f834c9bd1..ff815741ef 100644 --- a/test/decompiler/reference/engine/camera/camera_REF.gc +++ b/test/decompiler/reference/engine/camera/camera_REF.gc @@ -385,7 +385,10 @@ (format (clear *cam-res-string*) "~S-flags" arg0) (set! (-> obj flags) - (the-as uint (cam-slave-get-flags arg1 (string->symbol *res-key-string*))) + (the-as + cam-index-options + (cam-slave-get-flags arg1 (string->symbol *res-key-string*)) + ) ) (let ((s3-2 (res-lump-data arg1 arg0 pointer)) (s0-1 (method-of-type res-lump get-property-struct)) @@ -455,7 +458,7 @@ (let ((s4-1 (new-stack-vector0))) 0.0 (cond - ((logtest? (-> obj flags) 2) + ((logtest? (-> obj flags) (cam-index-options SPHERICAL)) (vector-! s4-1 (-> obj vec 1) arg2) (set! (-> obj vec 1 w) (vector-length s4-1)) (vector-! s4-1 (the-as vector (-> obj vec)) arg2) @@ -463,7 +466,7 @@ (set! (-> obj vec 1 w) (- (-> obj vec 1 w) (-> obj vec 1 x))) (set! (-> obj vec 0 quad) (-> arg2 quad)) ) - ((logtest? (-> obj flags) 1) + ((logtest? (-> obj flags) (cam-index-options RADIAL)) (vector-! s4-1 (-> obj vec 1) arg2) (set! (-> obj vec 1 w) (vector-length s4-1)) (vector-! s4-1 (the-as vector (-> obj vec)) arg2) @@ -487,11 +490,11 @@ 0.0 (vector-! s5-0 arg0 (the-as vector (-> obj vec))) (cond - ((logtest? (-> obj flags) 2) + ((logtest? (-> obj flags) (cam-index-options SPHERICAL)) (vector-flatten! s5-0 s5-0 (-> *camera* local-down)) (/ (- (vector-length s5-0) (-> obj vec 1 x)) (-> obj vec 1 w)) ) - ((logtest? (-> obj flags) 1) + ((logtest? (-> obj flags) (cam-index-options RADIAL)) (/ (- (vector-length s5-0) (-> obj vec 1 x)) (-> obj vec 1 w)) ) (else @@ -940,11 +943,11 @@ ((< f26-0 0.0) (if (and *debug-segment* *display-camera-marks*) (camera-line-rel-len - (-> obj point s1-0) + (the-as vector (-> obj point s1-0)) s2-0 (* -40.96 f26-0) (the-as - rgba + vector4w (new 'static 'inline-array qword 1 (new 'static 'qword :data @@ -958,11 +961,11 @@ ) ((and *debug-segment* *display-camera-marks*) (camera-line-rel-len - (-> obj point s1-0) + (the-as vector (-> obj point s1-0)) s2-0 (* 40.96 f26-0) (the-as - rgba + vector4w (new 'static 'inline-array qword 1 (new 'static 'qword :data @@ -1174,7 +1177,7 @@ (set! (-> self intro-t) 1.0) (set! (-> self intro-t-step) 0.0) (set! (-> self spline-exists) #f) - (set! (-> self los-state) (the-as uint 0)) + (set! (-> self los-state) (slave-los-state none)) (set! (-> self enter-has-run) #f) (set! (-> self cam-entity) #f) (set! (-> self tracking no-follow) #f) diff --git a/test/decompiler/reference/engine/gfx/font-h_REF.gc b/test/decompiler/reference/engine/gfx/font-h_REF.gc index 1eb24b627d..6c6c6c729d 100644 --- a/test/decompiler/reference/engine/gfx/font-h_REF.gc +++ b/test/decompiler/reference/engine/gfx/font-h_REF.gc @@ -407,8 +407,7 @@ (new 'static 'vector :z 1.0) ) ) - :color-shadow - (new 'static 'vector4w :data (new 'static 'array int32 4 0 0 0 #x80)) + :color-shadow (new 'static 'vector4w :w #x80) :color-table (new 'static 'inline-array char-color 64 (new 'static 'char-color diff --git a/test/decompiler/reference/engine/gfx/shrub/shrub-work_REF.gc b/test/decompiler/reference/engine/gfx/shrub/shrub-work_REF.gc index 73dc04868c..2a34bf9623 100644 --- a/test/decompiler/reference/engine/gfx/shrub/shrub-work_REF.gc +++ b/test/decompiler/reference/engine/gfx/shrub/shrub-work_REF.gc @@ -586,10 +586,7 @@ (new 'static 'vector :x 0.5 :y 100.0 :z 0.0166 :w -1.0) :constants (new 'static 'vector :x 128.0 :y 1.0) :color-constant - (new 'static 'vector4w - :data - (new 'static 'array int32 4 #x47000000 #x47000000 #x47000000 0) - ) + (new 'static 'vector4w :x #x47000000 :y #x47000000 :z #x47000000) :start-bank (new 'static 'array uint8 20 #x0 diff --git a/test/decompiler/reference/engine/math/vector-h_REF.gc b/test/decompiler/reference/engine/math/vector-h_REF.gc index 9d0d6fd3b1..84424a994f 100644 --- a/test/decompiler/reference/engine/math/vector-h_REF.gc +++ b/test/decompiler/reference/engine/math/vector-h_REF.gc @@ -250,13 +250,13 @@ ;; definition of type vector4w (deftype vector4w (structure) - ((data int32 4 :offset-assert 0) - (x int32 :offset 0) - (y int32 :offset 4) - (z int32 :offset 8) - (w int32 :offset 12) - (dword uint64 2 :offset 0) - (quad uint128 :offset 0) + ((data int32 4 :offset 0) + (x int32 :offset 0) + (y int32 :offset 4) + (z int32 :offset 8) + (w int32 :offset 12) + (dword uint64 2 :offset 0) + (quad uint128 :offset 0) ) :method-count-assert 9 :size-assert #x10 diff --git a/test/decompiler/reference/engine/target/target-util_REF.gc b/test/decompiler/reference/engine/target/target-util_REF.gc index 559b0fac40..1cbc02e43b 100644 --- a/test/decompiler/reference/engine/target/target-util_REF.gc +++ b/test/decompiler/reference/engine/target/target-util_REF.gc @@ -60,13 +60,13 @@ (swim-jump-height-max meters :offset-assert 68) (tube-jump-height-min meters :offset-assert 72) (tube-jump-height-max meters :offset-assert 76) - (wheel-duration uint64 :offset-assert 80) - (wheel-jump-pre-window uint64 :offset-assert 88) - (wheel-jump-post-window uint64 :offset-assert 96) - (wheel-timeout uint64 :offset-assert 104) + (wheel-duration seconds :offset-assert 80) + (wheel-jump-pre-window seconds :offset-assert 88) + (wheel-jump-post-window seconds :offset-assert 96) + (wheel-timeout seconds :offset-assert 104) (wheel-speed-min meters :offset-assert 112) (wheel-speed-inc meters :offset-assert 116) - (wheel-flip-duration uint64 :offset-assert 120) + (wheel-flip-duration seconds :offset-assert 120) (wheel-flip-height meters :offset-assert 128) (wheel-flip-dist meters :offset-assert 132) (wheel-flip-art-height meters :offset-assert 136) @@ -74,13 +74,13 @@ (duck-slide-distance meters :offset-assert 144) (fall-far meters :offset-assert 148) (fall-far-inc meters :offset-assert 152) - (attack-timeout uint64 :offset-assert 160) - (ground-timeout uint64 :offset-assert 168) - (slide-down-timeout uint64 :offset-assert 176) - (fall-timeout uint64 :offset-assert 184) + (attack-timeout seconds :offset-assert 160) + (ground-timeout seconds :offset-assert 168) + (slide-down-timeout seconds :offset-assert 176) + (fall-timeout seconds :offset-assert 184) (fall-stumble-threshold meters :offset-assert 192) (yellow-projectile-speed meters :offset-assert 196) - (hit-invulnerable-timeout uint64 :offset-assert 200) + (hit-invulnerable-timeout seconds :offset-assert 200) (run-cycle-length float :offset-assert 208) (walk-cycle-dist meters :offset-assert 212) (walk-up-cycle-dist meters :offset-assert 216) @@ -122,7 +122,7 @@ (stuck-distance meters :offset-assert 576) (tongue-pull-speed-min float :offset-assert 580) (tongue-pull-speed-max float :offset-assert 584) - (yellow-attack-timeout uint64 :offset-assert 592) + (yellow-attack-timeout seconds :offset-assert 592) ) :method-count-assert 9 :size-assert #x258 @@ -368,12 +368,12 @@ :swim-jump-height-max (meters 5.0) :tube-jump-height-min (meters 1.75) :tube-jump-height-max (meters 2.5) - :wheel-duration #x96 - :wheel-jump-pre-window #x12c - :wheel-jump-post-window #x1e + :wheel-duration (seconds 0.5) + :wheel-jump-pre-window (seconds 1) + :wheel-jump-post-window (seconds 0.1) :wheel-speed-min (meters 11.5) :wheel-speed-inc (meters 1.5) - :wheel-flip-duration #xd2 + :wheel-flip-duration (seconds 0.7) :wheel-flip-height (meters 3.52) :wheel-flip-dist (meters 17.3) :wheel-flip-art-height (meters 3.2969) @@ -381,13 +381,13 @@ :duck-slide-distance (meters 5.75) :fall-far (meters 30.0) :fall-far-inc (meters 20.0) - :attack-timeout #x5a - :ground-timeout #x3c - :slide-down-timeout #x3c - :fall-timeout #x12c + :attack-timeout (seconds 0.3) + :ground-timeout (seconds 0.2) + :slide-down-timeout (seconds 0.2) + :fall-timeout (seconds 1) :fall-stumble-threshold (meters 39.9) :yellow-projectile-speed (meters 60.0) - :hit-invulnerable-timeout #x384 + :hit-invulnerable-timeout (seconds 3) :run-cycle-length 60.0 :walk-cycle-dist (meters 2.8) :walk-up-cycle-dist (meters 2.8) @@ -429,7 +429,7 @@ :stuck-distance (meters 0.05) :tongue-pull-speed-min 0.15 :tongue-pull-speed-max 0.22 - :yellow-attack-timeout #x3c + :yellow-attack-timeout (seconds 0.2) ) ) @@ -1433,7 +1433,7 @@ ;; definition for function target-timed-invulnerable ;; INFO: Return type mismatch int vs none. -(defun target-timed-invulnerable ((arg0 uint) (arg1 target)) +(defun target-timed-invulnerable ((arg0 seconds) (arg1 target)) (logior! (-> arg1 state-flags) 32) (set! (-> arg1 control unknown-dword70) (-> *display* base-frame-counter)) (set! (-> arg1 control unknown-dword71) (the-as int arg0)) diff --git a/test/decompiler/reference/levels/finalboss/robotboss-weapon_REF.gc b/test/decompiler/reference/levels/finalboss/robotboss-weapon_REF.gc index f37a467494..792f985bd2 100644 --- a/test/decompiler/reference/levels/finalboss/robotboss-weapon_REF.gc +++ b/test/decompiler/reference/levels/finalboss/robotboss-weapon_REF.gc @@ -247,11 +247,7 @@ (set! (-> s5-0 quad) (-> self from quad)) (dotimes (s4-0 30) (arcing-shot-calculate gp-0 (* 0.033333335 (the float (+ s4-0 1)))) - (camera-line - gp-0 - s5-0 - (new 'static 'vector4w :data (new 'static 'array int32 4 #xff #xff 0 #x80)) - ) + (camera-line gp-0 s5-0 (new 'static 'vector4w :x #xff :y #xff :w #x80)) (set! (-> s5-0 quad) (-> gp-0 quad)) ) )