mirror of
https://github.com/open-goal/jak-project
synced 2026-07-07 14:13:45 -04:00
[decomp] add (most) PAL changes to main (#925)
* add (most) PAL changes to `main` * fix examplecam movement * fix up camera code * Use `score` system when decompiling structures * typo * restore asserts
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"]],
|
||||
|
||||
@@ -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": []
|
||||
}
|
||||
|
||||
@@ -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": {}
|
||||
}
|
||||
|
||||
@@ -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)"]],
|
||||
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
)
|
||||
|
||||
)
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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 <GMJ>: alternate region activate failed~%"
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(let ((s1-1 format)
|
||||
(s0-1 0)
|
||||
)
|
||||
(set!
|
||||
sv-128
|
||||
"ERROR <GMJ>: 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 <GMJ>: 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 <GMJ>: alternate region activate failed~%"
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(let ((s1-1 format)
|
||||
(s0-1 0)
|
||||
)
|
||||
(set!
|
||||
sv-128
|
||||
"ERROR <GMJ>: 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 <GMJ>: 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
|
||||
)
|
||||
|
||||
@@ -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
|
||||
|
||||
+244
-202
@@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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))
|
||||
)
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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)))
|
||||
)
|
||||
|
||||
|
||||
@@ -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))
|
||||
)
|
||||
)
|
||||
|
||||
@@ -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)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+134
-276
File diff suppressed because it is too large
Load Diff
+35
-19
@@ -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
|
||||
|
||||
+5
-5
@@ -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)
|
||||
|
||||
+13
-10
@@ -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)
|
||||
|
||||
+1
-2
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
+7
-7
@@ -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
|
||||
|
||||
+22
-22
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user