random clean-up (#551)

* clean-up various files, do `game-h` and `generic-obs-h`

* cleanup `smush-control-h`

* cleanup `collide-edge-grab-h`, `collide-mesh-h`, `collide-shape-h`

* [goal lib]organize minor things

* Fix a library command before I forget again

* fix
This commit is contained in:
ManDude 2021-06-04 18:22:50 +01:00 committed by GitHub
parent 2bfe13d0be
commit 9b905f903c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 2311 additions and 2220 deletions

File diff suppressed because it is too large Load diff

View file

@ -224,7 +224,13 @@
"sync-info": [
["L78", "float", true],
["L79", "float", true],
["L80", "float", true],
["L81", "float", true],
["L82", "float", true],
["L83", "float", true],
["L84", "float", true],
["L85", "float", true],
["L86", "float", true]
],

View file

@ -460,6 +460,16 @@
"ripple-find-height": [
[[22, 72], "s4", "mei-ripple"]
],
"(method 0 collide-shape-prim-sphere)": [
[[4, 8], "v0", "collide-shape-prim-sphere"]
],
"(method 0 collide-shape-prim-mesh)": [
[[6, 11], "v0", "collide-shape-prim-mesh"]
],
"(method 0 collide-shape-prim-group)": [
[[11, 18], "v0", "collide-shape-prim-group"]
],
"camera-teleport-to-entity": [
[9, "a0", "transform"]

View file

@ -1529,13 +1529,16 @@
},
"(method 0 collide-shape-prim-sphere)": {
"args": ["allocation", "type-to-make", "cshape", "prim-id"]
"args": ["allocation", "type-to-make", "cshape", "prim-id"],
"vars": { "v0-0": ["obj", "collide-shape-prim-sphere"] }
},
"(method 0 collide-shape-prim-mesh)": {
"args": ["allocation", "type-to-make", "cshape", "mesh-id", "prim-id"]
"args": ["allocation", "type-to-make", "cshape", "mesh-id", "prim-id"],
"vars": { "v0-0": ["obj", "collide-shape-prim-mesh"] }
},
"(method 0 collide-shape-prim-group)": {
"args": ["allocation", "type-to-make", "cshape", "elt-count", "prim-id"]
"args": ["allocation", "type-to-make", "cshape", "elt-count", "prim-id"],
"vars": { "v0-0": ["obj", "collide-shape-prim-group"] }
},
"(method 0 collide-shape)": {
"args": [
@ -1547,6 +1550,9 @@
],
"vars": { "s5-0": "obj" }
},
"(method 0 collide-sticky-rider-group)": {
"vars": { "v0-0": "obj" }
},
"(method 11 touching-prims-entry-pool)": {
"vars": { "a1-0": "current", "v1-0": "prev", "a2-0": "next" }
},

View file

@ -5,16 +5,16 @@
;; name in dgo: aligner-h
;; dgos: GAME, ENGINE
;; definition of type align-control
(deftype align-control (basic)
((flags uint32 :offset-assert 4)
(process basic :offset-assert 8)
(process process :offset-assert 8)
(frame-group basic :offset-assert 12)
(frame-num float :offset-assert 16)
(matrix matrix 2 :inline :offset-assert 32)
(transform transform 2 :inline :offset-assert 160)
(delta transformq :inline :offset-assert 256)
(last-speed float :offset-assert 304)
(last-speed float :offset-assert 304) ;; meters
(align transformq :inline :offset 160)
)
:method-count-assert 14
@ -30,38 +30,18 @@
)
)
;; definition for method 0 of type align-control
;; INFO: Return type mismatch object vs align-control.
(defmethod
new
align-control
((allocation symbol) (type-to-make type) (arg0 process))
(local-vars (pp process))
(let
((obj
(object-new allocation type-to-make (the-as int (-> type-to-make size)))
)
)
(if (zero? obj)
(return (begin
(let ((t9-1 (the-as (function object object) enter-state))
(a0-1 "memory")
)
(set!
(-> pp next-state)
(the-as state process-drawable-art-error)
)
(t9-1 a0-1)
)
(the-as align-control 0)
)
)
)
(set! (-> obj process) arg0)
obj
)
(defmethod new align-control ((allocation symbol) (type-to-make type) (proc process))
(let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
(when (zero? obj)
(go process-drawable-art-error "memory")
(return (the align-control 0))
)
(set! (-> obj process) proc)
obj
)
)

View file

@ -41,7 +41,7 @@
(deftype collide-edge-edge (structure)
((ignore basic :offset-assert 0)
(etri collide-edge-tri :offset-assert 4)
(vertex-ptr vector 2 :offset-assert 8)
(vertex-ptr vector 2 :offset-assert 8)
(outward vector :inline :offset-assert 16)
(edge-vec-norm vector :inline :offset-assert 32)
)
@ -64,11 +64,11 @@
)
(deftype collide-edge-hold-list (structure)
((num-allocs uint32 :offset-assert 0)
(num-attempts uint32 :offset-assert 4)
(head collide-edge-hold-item :offset-assert 8)
(items collide-edge-hold-item 32 :inline :offset-assert 16)
(attempts qword 32 :inline :offset-assert 1552)
((num-allocs uint32 :offset-assert 0)
(num-attempts uint32 :offset-assert 4)
(head collide-edge-hold-item :offset-assert 8)
(items collide-edge-hold-item 32 :inline :offset-assert 16)
(attempts qword 32 :inline :offset-assert 1552)
)
:method-count-assert 11
:size-assert #x810
@ -80,32 +80,32 @@
)
(deftype collide-edge-work (structure)
((ccache basic :offset-assert 0)
(cshape basic :offset-assert 4)
(num-verts uint32 :offset-assert 8)
(num-edges uint32 :offset-assert 12)
(num-tris uint32 :offset-assert 16)
(cache-fill-box bounding-box :inline :offset-assert 32)
(within-reach-box bounding-box :inline :offset-assert 64)
(within-reach-box4w bounding-box4w :inline :offset-assert 96)
(search-pt vector :inline :offset-assert 128)
(search-dir-vec vector :inline :offset-assert 144)
(max-dist-sqrd-to-outward-pt float :offset-assert 160)
(max-dir-cosa-delta float :offset-assert 164)
(split-dists float 2 :offset-assert 168)
(outward-offset vector :inline :offset-assert 176)
(local-cache-fill-box bounding-box :inline :offset-assert 192)
(local-within-reach-box bounding-box :inline :offset-assert 224)
(local-player-spheres sphere 12 :inline :offset-assert 256)
(world-player-spheres sphere 12 :inline :offset-assert 448)
(local-player-hanging-spheres sphere 6 :inline :offset 256)
(world-player-hanging-spheres sphere 6 :inline :offset 448)
(local-player-leap-up-spheres sphere 6 :inline :offset 352)
(world-player-leap-up-spheres sphere 6 :inline :offset 544)
(verts vector 64 :inline :offset-assert 640)
(edges collide-edge-edge 96 :inline :offset-assert 1664)
(tris collide-edge-tri 48 :inline :offset-assert 6272)
(hold-list collide-edge-hold-list :inline :offset-assert 7808)
((ccache basic :offset-assert 0)
(cshape basic :offset-assert 4)
(num-verts uint32 :offset-assert 8)
(num-edges uint32 :offset-assert 12)
(num-tris uint32 :offset-assert 16)
(cache-fill-box bounding-box :inline :offset-assert 32)
(within-reach-box bounding-box :inline :offset-assert 64)
(within-reach-box4w bounding-box4w :inline :offset-assert 96)
(search-pt vector :inline :offset-assert 128)
(search-dir-vec vector :inline :offset-assert 144)
(max-dist-sqrd-to-outward-pt float :offset-assert 160)
(max-dir-cosa-delta float :offset-assert 164)
(split-dists float 2 :offset-assert 168)
(outward-offset vector :inline :offset-assert 176)
(local-cache-fill-box bounding-box :inline :offset-assert 192)
(local-within-reach-box bounding-box :inline :offset-assert 224)
(local-player-spheres sphere 12 :inline :offset-assert 256)
(world-player-spheres sphere 12 :inline :offset-assert 448)
(local-player-hanging-spheres sphere 6 :inline :offset 256)
(world-player-hanging-spheres sphere 6 :inline :offset 448)
(local-player-leap-up-spheres sphere 6 :inline :offset 352)
(world-player-leap-up-spheres sphere 6 :inline :offset 544)
(verts vector 64 :inline :offset-assert 640)
(edges collide-edge-edge 96 :inline :offset-assert 1664)
(tris collide-edge-tri 48 :inline :offset-assert 6272)
(hold-list collide-edge-hold-list :inline :offset-assert 7808)
)
:method-count-assert 20
:size-assert #x2690
@ -125,107 +125,34 @@
)
)
(define *collide-edge-work*
(new 'static 'collide-edge-work
:max-dist-sqrd-to-outward-pt 37748736.000000
:max-dir-cosa-delta (the-as float #x3f19999a)
:split-dists (new 'static 'array float 2 1024.000000 (the-as float #x44b33333))
:outward-offset (new 'static 'vector
:x (the-as float #x443126e9)
:y 13312.000000
:w 1.000000
)
:local-cache-fill-box (new 'static 'bounding-box
:min (new 'static 'vector
:x -8192.000000
:y (the-as float #xc62ccccd)
:z -8192.000000
:w 1.000000
)
:max (new 'static 'vector
:x 8192.000000
:y 24576.000000
:z 8192.000000
:w 1.000000
)
(define *collide-edge-work* (new 'static 'collide-edge-work
:max-dist-sqrd-to-outward-pt 37748736.0
:max-dir-cosa-delta 0.6
:split-dists (new 'static 'array float 2 1024.0 1433.6)
:outward-offset (new 'static 'vector :x 708.608 :y 13312.0 :w 1.0)
:local-cache-fill-box (new 'static 'bounding-box
:min (new 'static 'vector :x -8192.0 :y -11059.2 :z -8192.0 :w 1.0)
:max (new 'static 'vector :x 8192.0 :y 24576.0 :z 8192.0 :w 1.0)
)
:local-within-reach-box (new 'static 'bounding-box
:min (new 'static 'vector
:x -6144.000000
:y (the-as float #x45a66666)
:z -6144.000000
:w 1.000000
)
:max (new 'static 'vector
:x 6144.000000
:y (the-as float #x462ccccd)
:z 6144.000000
:w 1.000000
)
)
:local-player-spheres (new 'static 'inline-array sphere 12
(new 'static 'sphere
:x (the-as float #x44d70a3d)
:y (the-as float #xc44ccccd)
:w (the-as float #x44b33333)
)
(new 'static 'sphere
:x (the-as float #x450f5c29)
:y (the-as float #xc54ccccd)
:w (the-as float #x44eb851f)
)
(new 'static 'sphere
:x (the-as float #x44f5c28f)
:y -6144.000000
:w (the-as float #x44c28f5c)
)
(new 'static 'sphere
:x (the-as float #x44f5c28f)
:y (the-as float #xc6066666)
:w (the-as float #x44c28f5c)
)
(new 'static 'sphere
:x (the-as float #x44dc28f6)
:y (the-as float #xc62ccccd)
:w (the-as float #x44a8f5c3)
)
(new 'static 'sphere
:x (the-as float #x44d1eb85)
:y -13312.000000
:w (the-as float #x449eb852)
)
(new 'static 'sphere
:x (the-as float #xc43851ec)
:y 4096.000000
:w 3072.000000
)
(new 'static 'sphere
:x (the-as float #xc43851ec)
:y (the-as float #x45cccccd)
:w 3072.000000
)
(new 'static 'sphere
:x (the-as float #xc43851ec)
:y (the-as float #x46133333)
:w 3072.000000
)
(new 'static 'sphere
:x (the-as float #x44d70a3d)
:y (the-as float #x45666666)
:w (the-as float #x453851ec)
)
(new 'static 'sphere
:x (the-as float #x44d70a3d)
:y (the-as float #x45b33333)
:w (the-as float #x453851ec)
)
(new 'static 'sphere
:x (the-as float #x44d70a3d)
:y (the-as float #x46066666)
:w (the-as float #x453851ec)
)
:local-within-reach-box (new 'static 'bounding-box
:min (new 'static 'vector :x -6144.0 :y 5324.8 :z -6144.0 :w 1.0)
:max (new 'static 'vector :x 6144.0 :y 11059.2 :z 6144.0 :w 1.0)
)
)
:local-player-spheres (new 'static 'inline-array sphere 12
(new 'static 'sphere :x 1720.32 :y -819.2 :w 1433.6)
(new 'static 'sphere :x 2293.76 :y -3276.8 :w 1884.16)
(new 'static 'sphere :x 1966.08 :y -6144.0 :w 1556.48)
(new 'static 'sphere :x 1966.08 :y -8601.6 :w 1556.48)
(new 'static 'sphere :x 1761.28 :y -11059.2 :w 1351.68)
(new 'static 'sphere :x 1679.36 :y -13312.0 :w 1269.76)
(new 'static 'sphere :x -737.28 :y 4096.0 :w 3072.0)
(new 'static 'sphere :x -737.28 :y 6553.6 :w 3072.0)
(new 'static 'sphere :x -737.28 :y 9420.8 :w 3072.0)
(new 'static 'sphere :x 1720.32 :y 3686.4 :w 2949.12)
(new 'static 'sphere :x 1720.32 :y 5734.4 :w 2949.12)
(new 'static 'sphere :x 1720.32 :y 8601.6 :w 2949.12)
)
)
)
(define-perm *edge-grab-info* edge-grab-info (new 'global 'edge-grab-info))

View file

@ -49,12 +49,13 @@
)
)
(defconstant COLLIDE_MESH_CACHE_SIZE #xa000)
(deftype collide-mesh-cache (basic)
((used-size uint32 :offset-assert 4)
(max-size uint32 :offset-assert 8)
(id uint64 :offset-assert 16)
(pad uint8 8) ;; added
(data uint8 40960 :offset-assert 32)
(data uint8 #xa000 :offset 32)
)
:method-count-assert 12
:size-assert #xa020
@ -105,12 +106,9 @@
)
;; only allocate if we don't have an existing one.
(define-extern *collide-mesh-cache* collide-mesh-cache)
(if (or (not *collide-mesh-cache*) (zero? *collide-mesh-cache*))
(set! *collide-mesh-cache* (new 'global 'collide-mesh-cache))
)
(define-perm *collide-mesh-cache* collide-mesh-cache (new 'global 'collide-mesh-cache))
;; in all cases, re-init.
(set! (-> *collide-mesh-cache* id) 1)
(set! (-> *collide-mesh-cache* used-size) 0)
(set! (-> *collide-mesh-cache* max-size) #xa000)
(set! (-> *collide-mesh-cache* max-size) COLLIDE_MESH_CACHE_SIZE)

View file

@ -93,7 +93,8 @@
(defmethod reset! collide-overlap-result ((obj collide-overlap-result))
"Reset the result."
(set! (-> obj best-dist) 0.000000)
(set! (-> obj best-dist) 0.0)
(set! (-> obj best-from-prim) #f)
(set! (-> obj best-to-prim) #f)
(none)
@ -109,18 +110,9 @@
)
;; The engine system is used to link collision checks with processes.
(define *collide-hit-by-player-list*
(new 'global 'engine 'collide-hit-by-player-list 768)
)
(define *collide-usually-hit-by-player-list*
(new 'global 'engine 'collide-usually-hit-by-player-list 256)
)
(define *collide-hit-by-others-list*
(new 'global 'engine 'collide-hit-by-others-list 96)
)
(define *collide-hit-by-player-list* (new 'global 'engine 'collide-hit-by-player-list 768))
(define *collide-usually-hit-by-player-list* (new 'global 'engine 'collide-usually-hit-by-player-list 256))
(define *collide-hit-by-others-list* (new 'global 'engine 'collide-hit-by-others-list 96))
(define *collide-player-list* (new 'global 'engine 'collide-player-list 32))
;; some parts of collide-shape-prim are broken out here.
@ -285,6 +277,12 @@
)
)
(defenum collide-list-enum
(hit-by-player)
(usually-hit-by-player)
(hit-by-others)
(player)
)
;; an actual instance of a collision primitive.
;; it's based on a transform (q means quaternion, v means with derivatives)
(deftype collide-shape (trsqv)
@ -304,7 +302,7 @@
:size-assert #xb8
:flag-assert #x38000000b8
(:methods
(new (symbol type process int) _type_)
(new (symbol type process collide-list-enum) _type_)
(dummy-28 () none 28)
(dummy-29 () none 29)
(dummy-30 () none 30)
@ -383,83 +381,59 @@
(defmethod new collide-shape-prim ((allocation symbol) (type-to-make type) (cshape basic) (prim-id uint) (size-bytes int))
"Allocate a new collide-shape-prim. It is expected that children of collide-shape-prim override this.
NOTE: uses the size-bytes as the TOTAL size of the structure."
(local-vars (v0-0 collide-shape-prim))
(set! v0-0 (object-new allocation type-to-make size-bytes))
;; not sure what this is.
(set! (-> v0-0 cshape) cshape)
;; sphere/mesh?
(set! (-> v0-0 prim-id) prim-id)
(set! (-> v0-0 prim-core action) 0)
(set! (-> v0-0 prim-core collide-as) 0)
(set! (-> v0-0 collide-with) 0)
(set! (-> v0-0 transform-index) -2)
(set! (-> v0-0 prim-core offense) 0)
(set! (-> v0-0 prim-core prim-type) -2)
v0-0
(let ((obj (object-new allocation type-to-make size-bytes)))
;; not sure what this is.
(set! (-> obj cshape) cshape)
;; sphere/mesh?
(set! (-> obj prim-id) prim-id)
(set! (-> obj prim-core action) 0)
(set! (-> obj prim-core collide-as) 0)
(set! (-> obj collide-with) 0)
(set! (-> obj transform-index) -2)
(set! (-> obj prim-core offense) 0)
(set! (-> obj prim-core prim-type) -2)
obj
)
)
(defmethod new collide-shape-prim-sphere ((allocation symbol) (type-to-make type) (cshape basic) (prim-id uint))
"Allocate a new sphere primitive"
(local-vars (v0-0 collide-shape-prim-sphere))
(set! v0-0
(the collide-shape-prim-sphere
((method-of-type collide-shape-prim new)
allocation
type-to-make
cshape
prim-id
76
)
)
)
(set! (-> v0-0 pat) 16) ;; todo - bitfield
(set! (-> v0-0 prim-core prim-type) -1)
v0-0
(let ((obj (the collide-shape-prim-sphere ((method-of-type collide-shape-prim new) allocation type-to-make cshape prim-id (size-of collide-shape-prim-mesh)))))
(set! (-> obj pat) #x10)
(set! (-> obj prim-core prim-type) -1)
obj
)
)
(defmethod new collide-shape-prim-mesh ((allocation symbol) (type-to-make type) (cshape basic) (mesh-id uint) (prim-id uint))
"Allocate a new mesh primitive"
(local-vars (v0-0 collide-shape-prim-mesh))
(set! v0-0 (the collide-shape-prim-mesh
((method-of-type collide-shape-prim new)
allocation
type-to-make
cshape
prim-id
92
)
)
)
(set! (-> (the-as collide-shape-prim-mesh v0-0) mesh) #f)
(set! (-> v0-0 mesh-id) (the int mesh-id))
(set! (-> v0-0 mesh-cache-id) 0)
(set! (-> v0-0 prim-core prim-type) 1)
v0-0
(let ((obj (the collide-shape-prim-mesh ((method-of-type collide-shape-prim new) allocation type-to-make cshape prim-id (size-of collide-shape-prim-mesh)))))
(set! (-> obj mesh) #f)
(set! (-> obj mesh-id) (the int mesh-id))
(set! (-> obj mesh-cache-id) 0)
(set! (-> obj prim-core prim-type) 1)
obj
)
)
(defmethod new collide-shape-prim-group ((allocation symbol) (type-to-make type) (cshape basic) (elt-count uint) (prim-id int))
"Allocate a group of primitives."
(local-vars (v0-0 collide-shape-prim-group))
(set! v0-0 (the collide-shape-prim-group
((method-of-type collide-shape-prim new)
allocation
type-to-make
cshape
(the-as uint prim-id)
;; minus one for the one reference in the type.
(the-as int (+ (-> type-to-make size) (shl (+ elt-count -1) 2)))
)
)
)
(set! (-> v0-0 allocated-prims) (the int elt-count))
(set! (-> v0-0 num-prims) 0)
(set! (-> v0-0 prim-core prim-type) 0)
(while (nonzero? elt-count)
(+! elt-count -1)
(set! (-> v0-0 prim elt-count) (the uint #f))
(nop!)
(let ((obj (the collide-shape-prim-group ((method-of-type collide-shape-prim new) allocation type-to-make cshape (the uint prim-id) (the int (+ (-> type-to-make size) (* (+ elt-count -1) 4)))))))
(set! (-> obj allocated-prims) (the int elt-count))
(set! (-> obj num-prims) 0)
(set! (-> obj prim-core prim-type) 0)
(while (nonzero? elt-count)
(+! elt-count -1)
(set! (-> obj prim elt-count) (the uint #f))
(nop!)
)
obj
)
v0-0
)
(defmethod length collide-shape-prim-group ((obj collide-shape-prim-group))
@ -474,60 +448,60 @@
)
)
(defmethod new collide-shape ((allocation symbol) (type-to-make type) (proc process) (collide-list-kind int))
(local-vars (v1-5 symbol) (obj collide-shape))
(set! obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))
(set! (-> obj process) proc)
(set! (-> obj max-iteration-count) 1)
(set! (-> obj nav-flags) 1)
(set! (-> obj event-self) #f)
(set! (-> obj event-other) #f)
(set! (-> obj riders) #f)
(set! (-> obj root-prim) #f)
(set! v1-5 (-> proc type symbol))
(defmethod new collide-shape ((allocation symbol) (type-to-make type) (proc process) (collide-list-kind collide-list-enum))
"Allocate a new collide-shape and add to a collide-list"
;; add a special ignore mask for the camera vs other things.
(if (= v1-5 'camera)
(set! (-> obj pat-ignore-mask) 2)
(set! (-> obj pat-ignore-mask) 1)
(let ((obj (object-new allocation type-to-make (the int (-> type-to-make size)))))
(set! (-> obj process) proc)
(set! (-> obj max-iteration-count) 1)
(set! (-> obj nav-flags) #x1)
(set! (-> obj event-self) #f)
(set! (-> obj event-other) #f)
(set! (-> obj riders) #f)
(set! (-> obj root-prim) #f)
;; add a special ignore mask for the camera vs other things.
(case (-> proc type symbol)
(('camera)
(set! (-> obj pat-ignore-mask) #x2)
(set! (-> obj pat-ignore-mask) #x1)
)
)
;; reset transformation to the origin.
(set! (-> obj trans w) 1.000000)
(quaternion-identity! (the-as quaternion (-> obj rot)))
(vector-identity! (-> obj scale))
;; reset transformation to the origin.
(set! (-> obj trans w) 1.0)
(quaternion-identity! (the-as quaternion (-> obj rot)))
(vector-identity! (-> obj scale))
;; add us to right list.
(cond
((zero? collide-list-kind)
(add-connection *collide-hit-by-player-list* proc (the (function object object object object object) #f) obj #f #f)
)
((= collide-list-kind 1)
(add-connection *collide-usually-hit-by-player-list* proc (the (function object object object object object) #f) obj #f #f)
)
((= collide-list-kind 2)
(add-connection *collide-hit-by-others-list* proc (the (function object object object object object) #f) obj #f #f)
)
((= collide-list-kind 3)
(add-connection *collide-player-list* proc (the (function object object object object object) #f) obj #f #f)
)
(else
(format 0 "Unsupported collide-list-enum in collide-shape constructor!~%")
)
;; add us to right list.
(case collide-list-kind
(((collide-list-enum hit-by-player))
(add-connection *collide-hit-by-player-list* proc (the (function object object object object object) #f) obj #f #f))
(((collide-list-enum usually-hit-by-player))
(add-connection *collide-usually-hit-by-player-list* proc (the (function object object object object object) #f) obj #f #f))
(((collide-list-enum hit-by-others))
(add-connection *collide-hit-by-others-list* proc (the (function object object object object object) #f) obj #f #f))
(((collide-list-enum player))
(add-connection *collide-player-list* proc (the (function object object object object object) #f) obj #f #f))
(else
(format 0 "Unsupported collide-list-enum in collide-shape constructor!~%"))
)
obj
)
obj
)
(defmethod new collide-sticky-rider-group ((allocation symbol) (type-to-make type) (arg0 int))
(local-vars (v0-0 collide-sticky-rider-group))
(set! v0-0
(object-new allocation type-to-make
(the-as int (+ (-> type-to-make size) (the-as uint (shl (+ arg0 -1) 5))))
)
)
(set! (-> v0-0 allocated-riders) arg0)
(set! (-> v0-0 num-riders) 0)
v0-0
(defmethod new collide-sticky-rider-group ((allocation symbol) (type-to-make type) (riders-amount int))
"Allocate a new collide-sticky-rider-group with space for riders-amount sticky riders."
(let ((obj (object-new allocation type-to-make (the int (+ (-> type-to-make size) (the uint (* (1- riders-amount) (size-of collide-sticky-rider))))))))
(set! (-> obj allocated-riders) riders-amount)
(set! (-> obj num-riders) 0)
obj
)
)
(defmethod length collide-sticky-rider-group ((obj collide-sticky-rider-group))
@ -536,42 +510,36 @@
(defmethod asize-of collide-sticky-rider-group ((obj collide-sticky-rider-group))
(the-as int
(+ (-> obj type size) (the-as uint (shl (+ (-> obj allocated-riders) -1) 5)))
(+ (-> obj type size) (the-as uint (* (1- (-> obj allocated-riders)) (size-of collide-sticky-rider))))
)
)
(define *collide-shape-prim-backgnd*
(new 'static 'collide-shape-prim-mesh
:cshape #f
:prim-core
(new 'static 'collide-prim-core
:world-sphere
(new 'static 'vector :w 204800000.000000)
:collide-as #x1
:action #x1
:offense 4
:prim-type 2
)
:local-sphere
(new 'static 'vector :w 204800000.000000)
:mesh #f
)
(new 'static 'collide-shape-prim-mesh
:cshape #f
:prim-core (new 'static 'collide-prim-core
:world-sphere (new 'static 'vector :w 204800000.0)
:collide-as #x1
:action #x1
:offense 4
:prim-type 2
)
:local-sphere (new 'static 'vector :w 204800000.0)
:mesh #f
)
)
(define *collide-shape-prim-water*
(new 'static 'collide-shape-prim-mesh
:cshape #f
:prim-core
(new 'static 'collide-prim-core
:world-sphere
(new 'static 'vector :w 204800000.000000)
:collide-as #x20
:action #x1
:offense 4
:prim-type 2
)
:local-sphere
(new 'static 'vector :w 204800000.000000)
:mesh #f
)
(new 'static 'collide-shape-prim-mesh
:cshape #f
:prim-core (new 'static 'collide-prim-core
:world-sphere (new 'static 'vector :w 204800000.0)
:collide-as #x20
:action #x1
:offense 4
:prim-type 2
)
:local-sphere (new 'static 'vector :w 204800000.0)
:mesh #f
)
)

View file

@ -5,29 +5,28 @@
;; name in dgo: game-h
;; dgos: GAME, ENGINE
; TODO - for hud-h.gc and ripple
(deftype process-drawable (process)
((root trsqv :offset-assert 112)
(node-list basic :offset-assert 116)
(draw draw-control :offset-assert 120)
(skel basic :offset-assert 124)
(nav basic :offset-assert 128)
(align basic :offset-assert 132)
(path basic :offset-assert 136)
(vol basic :offset-assert 140)
(fact basic :offset-assert 144)
(link basic :offset-assert 148)
(part basic :offset-assert 152)
(water basic :offset-assert 156)
(sound basic :offset-assert 160)
(state-flags uint32 :offset-assert 164)
(state-time uint64 :offset-assert 168)
((root trsqv :offset-assert 112)
(node-list basic :offset-assert 116)
(draw draw-control :offset-assert 120)
(skel basic :offset-assert 124)
(nav basic :offset-assert 128)
(align basic :offset-assert 132)
(path basic :offset-assert 136)
(vol basic :offset-assert 140)
(fact basic :offset-assert 144)
(link basic :offset-assert 148)
(part basic :offset-assert 152)
(water basic :offset-assert 156)
(sound basic :offset-assert 160)
(state-flags uint32 :offset-assert 164)
(state-time uint64 :offset-assert 168)
)
:heap-base #x40
:method-count-assert 20
:size-assert #xb0
:flag-assert #x14004000b0
;; inherited inspect of process
(:methods
(dummy-14 () none 14)
(dummy-15 () none 15)
@ -38,7 +37,59 @@
)
)
; TODO - for target-h
(deftype process-drawable-reserved (process-drawable)
()
:heap-base #x40
:method-count-assert 63
:size-assert #xb0
:flag-assert #x3f004000b0
(:methods
(dummy-20 () none 20)
(dummy-21 () none 21)
(dummy-22 () none 22)
(dummy-23 () none 23)
(dummy-24 () none 24)
(dummy-25 () none 25)
(dummy-26 () none 26)
(dummy-27 () none 27)
(dummy-28 () none 28)
(dummy-29 () none 29)
(dummy-30 () none 30)
(dummy-31 () none 31)
(dummy-32 () none 32)
(dummy-33 () none 33)
(dummy-34 () none 34)
(dummy-35 () none 35)
(dummy-36 () none 36)
(dummy-37 () none 37)
(dummy-38 () none 38)
(dummy-39 () none 39)
(dummy-40 () none 40)
(dummy-41 () none 41)
(dummy-42 () none 42)
(dummy-43 () none 43)
(dummy-44 () none 44)
(dummy-45 () none 45)
(dummy-46 () none 46)
(dummy-47 () none 47)
(dummy-48 () none 48)
(dummy-49 () none 49)
(dummy-50 () none 50)
(dummy-51 () none 51)
(dummy-52 () none 52)
(dummy-53 () none 53)
(dummy-54 () none 54)
(dummy-55 () none 55)
(dummy-56 () none 56)
(dummy-57 () none 57)
(dummy-58 () none 58)
(dummy-59 () none 59)
(dummy-60 () none 60)
(dummy-61 () none 61)
(dummy-62 () none 62)
)
)
(deftype attack-info (structure)
((trans vector :inline :offset-assert 0)
(vector vector :inline :offset-assert 16)
@ -47,13 +98,13 @@
(invinc-time uint64 :offset-assert 56)
(mask uint32 :offset-assert 64)
(mode basic :offset-assert 68)
(shove-back float :offset-assert 72) ;; meters
(shove-up float :offset-assert 76) ;; meters
(speed float :offset-assert 80) ;; meters
(dist float :offset-assert 84) ;; meters
(shove-back float :offset-assert 72) ;; meters
(shove-up float :offset-assert 76) ;; meters
(speed float :offset-assert 80) ;; meters
(dist float :offset-assert 84) ;; meters
(control float :offset-assert 88)
(angle basic :offset-assert 92)
(rotate-to float :offset-assert 96) ;; deg
(rotate-to float :offset-assert 96) ;; deg
(prev-state basic :offset-assert 100)
)
:method-count-assert 10
@ -64,3 +115,17 @@
(dummy-9 () none 9)
)
)
(define *global-attack-id* 0)
(deftype ground-tween-info (structure)
((chan uint8 3 :offset-assert 0)
(blend uint32 3 :offset-assert 4)
(group uint32 5 :offset-assert 16)
)
:method-count-assert 9
:size-assert #x24
:flag-assert #x900000024
)

View file

@ -5,7 +5,141 @@
;; name in dgo: generic-obs-h
;; dgos: GAME, ENGINE
;; TODO - for task-control-h
(deftype manipy (process-drawable)
((new-trans-hook function :offset-assert 176)
(cur-trans-hook function :offset-assert 180)
(cur-event-hook function :offset-assert 184)
(new-joint-anim basic :offset-assert 188)
(new-joint-anim-blend uint64 :offset-assert 192)
(anim-mode basic :offset-assert 200)
(cur-grab-handle uint64 :offset-assert 208)
(cur-target-handle uint64 :offset-assert 216)
(old-grab-pos vector :inline :offset-assert 224)
(joint joint 4 :offset-assert 240)
(new-post-hook function :offset-assert 256)
(cur-post-hook function :offset-assert 260)
(clone-copy-trans basic :offset-assert 264)
(shadow-backup basic :offset-assert 268)
(draw? symbol :offset-assert 272)
)
:heap-base #xb0
:method-count-assert 20
:size-assert #x114
:flag-assert #x1400b00114
;; inherited inspect of process-drawable
(:methods
(dummy-14 () none 14)
(dummy-15 () none 15)
(dummy-16 () none 16)
(dummy-17 () none 17)
(dummy-18 () none 18)
(dummy-19 () none 19)
)
)
(deftype part-spawner (process-drawable)
((mode uint32 :offset-assert 176)
(enable basic :offset-assert 180)
(radius float :offset-assert 184) ;; meters
(world-sphere sphere :inline :offset-assert 192)
)
:heap-base #x60
:method-count-assert 21
:size-assert #xd0
:flag-assert #x15006000d0
;; inherited inspect of process-drawable
(:methods
(dummy-20 () none 20)
)
)
(deftype part-tracker (process)
((root basic :offset-assert 112)
(part basic :offset-assert 116)
(target uint64 :offset-assert 120)
(callback basic :offset-assert 128)
(linger-callback basic :offset-assert 132)
(duration uint64 :offset-assert 136)
(linger-duration uint64 :offset-assert 144)
(start-time uint64 :offset-assert 152)
(offset vector :inline :offset-assert 160)
(userdata uint64 :offset-assert 176)
(user-time uint64 2 :offset-assert 184)
(user-vector vector 2 :inline :offset-assert 208)
(user-handle uint32 2 :offset-assert 240)
)
:heap-base #x90
:method-count-assert 14
:size-assert #xf8
:flag-assert #xe009000f8
;; inherited inspect of process
(:methods
)
)
(deftype camera-tracker (process)
(
;(name basic :offset-assert 4)
(grab-target uint64 :offset 120)
(grab-event basic :offset-assert 128)
(release-event basic :offset-assert 132)
(old-global-mask uint32 :offset-assert 136)
(old-self-mask uint32 :offset-assert 140)
(old-parent-mask uint32 :offset-assert 144)
(look-at-target uint64 :offset-assert 152)
(pov-target uint64 :offset-assert 160)
(work-process uint64 :offset-assert 168)
(anim-process uint64 :offset-assert 176)
(start-time uint64 :offset-assert 184)
(callback basic :offset-assert 192)
(userdata basic :offset-assert 196)
(message basic :offset-assert 200)
(border-value basic :offset-assert 204)
(mask-to-clear uint32 :offset-assert 208)
(script basic :offset-assert 212)
(script-line basic :offset-assert 216)
(script-func basic :offset-assert 220)
)
:heap-base #x70
:method-count-assert 15
:size-assert #xe0
:flag-assert #xf007000e0
;; inherited inspect of process
;; field ~Tuserdata is a basic loaded with a signed load
(:methods
(dummy-14 () none 14)
)
)
(deftype touch-tracker (process-drawable)
((duration uint64 :offset-assert 176)
(target uint64 :offset-assert 184)
(event basic :offset-assert 192)
(run-function basic :offset-assert 196)
(callback basic :offset-assert 200)
(event-mode basic :offset-assert 204)
)
:heap-base #x60
:method-count-assert 20
:size-assert #xd0
:flag-assert #x14006000d0
;; inherited inspect of process-drawable
)
(deftype swingpole (process)
((root basic :offset-assert 112)
(dir vector :inline :offset-assert 128)
(range float :offset-assert 144) ;; meters
(edge-length float :offset-assert 148) ;; meters
)
:heap-base #x30
:method-count-assert 14
:size-assert #x98
:flag-assert #xe00300098
;; inherited inspect of process
)
(deftype gui-query (structure)
((x-position int32 :offset-assert 0)
(y-position int32 :offset-assert 4)
@ -24,3 +158,33 @@
(dummy-10 () none 10)
)
)
(deftype othercam (process)
((hand uint64 :offset-assert 112)
(old-global-mask uint32 :offset-assert 120)
(mask-to-clear uint32 :offset-assert 124)
(cam-joint-index int32 :offset-assert 128)
(old-pos vector :inline :offset-assert 144)
(old-mat-z vector :inline :offset-assert 160)
(had-valid-frame basic :offset-assert 176)
(border-value basic :offset-assert 180)
(die? basic :offset-assert 184)
(survive-anim-end? basic :offset-assert 188)
(spooling? basic :offset-assert 192)
)
:heap-base #x60
:method-count-assert 14
:size-assert #xc4
:flag-assert #xe006000c4
;; inherited inspect of process
)
(deftype process-hidden (process)
()
:method-count-assert 15
:size-assert #x70
:flag-assert #xf00000070
(:methods
(dummy-14 () none 14)
)
)

View file

@ -7,6 +7,7 @@
(defun light-slerp ((out light) (a light) (b light) (alpha float))
"Linearly interpolate between two light's vectors. Alpha is clamped between 0 - 1."
(let ((clamped-alpha (fmax 0.0 (fmin 1.0 alpha))))
(vector-lerp! (-> out color) (-> a color) (-> b color) clamped-alpha)
(vector-deg-slerp
@ -27,6 +28,7 @@
(defun light-group-slerp ((out light-group) (a light-group) (b light-group) (alpha float))
"Linearly interpolate between each of the 4 vectors of two light-groups.
Alpha is clamped between 0 - 1."
(dotimes (vec-index 4)
(light-slerp
(-> out lights vec-index)
@ -50,51 +52,20 @@
(none)
)
(define *default-lights* (the-as vu-lights (new 'global 'vu-lights)))
(define *default-lights* (new 'global 'vu-lights))
(defun vu-lights-default! ((lights vu-lights))
"Initialize a lights object with default values"
(let ((ambient-light (-> lights ambient)))
(set! (-> ambient-light x) 0.3)
(set! (-> ambient-light y) 0.3)
(set! (-> ambient-light z) 0.3)
(set! (-> ambient-light w) 1.0)
)
(let ((red (-> lights color)))
(set! (-> red 0 x) 1.0)
(set! (-> red 0 y) 1.0)
(set! (-> red 0 z) 1.0)
(set! (-> red 0 w) 1.0)
)
(let ((green (-> lights color 1)))
(set! (-> green x) 0.2)
(set! (-> green y) 0.2)
(set! (-> green z) 0.2)
(set! (-> green w) 1.0)
)
(let ((blue (-> lights color 2)))
(set! (-> blue x) 0.0)
(set! (-> blue y) 0.0)
(set! (-> blue z) 0.0)
(set! (-> blue w) 1.0)
)
(let ((dir-light-x (-> lights direction)))
(set! (-> dir-light-x 0 x) 1.0)
(set! (-> dir-light-x 0 y) 0.0)
(set! (-> dir-light-x 0 z) 0.0)
(set! (-> dir-light-x 0 w) 1.0)
)
(let ((dir-light-y (-> lights direction 1)))
(set! (-> dir-light-y x) 0.0)
(set! (-> dir-light-y y) 1.0)
(set! (-> dir-light-y z) 0.0)
(set! (-> dir-light-y w) 1.0)
)
(let ((dir-light-z (-> lights direction 2)))
(set! (-> dir-light-z x) 0.0)
(set! (-> dir-light-z y) 0.0)
(set! (-> dir-light-z z) 1.0)
(set! (-> dir-light-z w) 1.0)
)
(set-vector! (-> lights ambient) 0.3 0.3 0.3 1.0)
(set-vector! (-> lights color 0) 1.0 1.0 1.0 1.0)
(set-vector! (-> lights color 1) 0.2 0.2 0.2 1.0)
(set-vector! (-> lights color 2) 0.0 0.0 0.0 1.0)
(set-vector! (-> lights direction 0) 1.0 0.0 0.0 1.0)
(set-vector! (-> lights direction 1) 0.0 1.0 0.0 1.0)
(set-vector! (-> lights direction 2) 0.0 0.0 1.0 1.0)
lights
)

View file

@ -33,84 +33,86 @@
)
(defmethod nonzero-amplitude? smush-control ((obj smush-control))
(!= (-> obj amp) 0.000000)
"Return #t if amp is not zero, #f otherwise"
(declare (inline))
(!= (-> obj amp) 0.0)
)
(defmethod set-zero! smush-control ((obj smush-control))
(set! (-> obj period) 0.000000)
(set! (-> obj duration) 0.000000)
(set! (-> obj amp) 0.000000)
(set! (-> obj damp-amp) 0.000000)
(set! (-> obj damp-period) 0.000000)
(set! (-> obj ticks) 0.000000)
(set! (-> obj period) 0.0)
(set! (-> obj duration) 0.0)
(set! (-> obj amp) 0.0)
(set! (-> obj damp-amp) 0.0)
(set! (-> obj damp-period) 0.0)
(set! (-> obj ticks) 0.0)
obj
)
(defmethod update! smush-control ((obj smush-control))
"Run the smush control and return the result. Updates the internal state."
(local-vars (period float) (time-since-period-start float) (time-since-start float))
(cond
((!= (-> obj amp) 0.000000)
(set! time-since-start
(the float (- (-> *display* base-frame-counter) (-> obj start-time)))
((nonzero-amplitude? obj)
(let* ((time-since-start (the float (- (-> *display* base-frame-counter) (-> obj start-time))))
;; use float to int rounding to figure out offset into the current period.
(time-since-period-start (- time-since-start (* (the float (the int (/ time-since-start (-> obj period)))) (-> obj period))))
)
;; we completed a new period!
(when (>= (- time-since-start (-> obj ticks)) (-> obj period))
;; once per period updates of amp/period
(set! (-> obj amp) (* (-> obj amp) (-> obj damp-amp)))
(set! (-> obj period) (* (-> obj period) (-> obj damp-period)))
;; store the ticks that we did this on
(set! (-> obj ticks) time-since-start)
;; you can set damp-period to a negative number to indicate
;; that it should die on the next update. Do that here.
(if (< (-> obj damp-period) 0.0)
(set-zero! obj)
)
)
(set! period (-> obj period))
;; use float to int rounding to figure out offset into the current period.
(set! time-since-period-start (- time-since-start
(* (the float (the int (/ time-since-start period))) period))
)
;; we completed a new period!
(when (>= (- time-since-start (-> obj ticks)) (-> obj period))
;; once per period updates of amp/period
(set! (-> obj amp) (* (-> obj amp) (-> obj damp-amp)))
(set! (-> obj period) (* (-> obj period) (-> obj damp-period)))
;; store the ticks that we did this on
(set! (-> obj ticks) time-since-start)
;; you can set damp-period to a negative number to indicate
;; that it should die on the next update. Do that here.
(if (< (-> obj damp-period) 0.000000)
;; absolute duraction check
(if (>= time-since-start (-> obj duration))
(set-zero! obj)
)
)
;; absolute duraction check
(if (>= time-since-start (-> obj duration))
(set-zero! obj)
;; sine term multiplied by amplitude, and scaled by how much is left to go.
(* (sin (/ (* DEGREES_PER_ROT time-since-period-start) (-> obj period)))
(* (-> obj amp)
(/ (- (-> obj duration) time-since-start) (-> obj duration)))
)
)
;; sine term multiplied by amplitude, and scaled by how much is left to go.
(* (sin (/ (* 65536.000000 time-since-period-start) (-> obj period)))
(* (-> obj amp)
(/ (- (-> obj duration) time-since-start) (-> obj duration)))
)
)
;; amplitude = 0, die.
(else 0.000000)
(else 0.0)
)
)
(defmethod get-no-update smush-control ((obj smush-control))
"Get the value, but don't update internal state"
(local-vars (f0-2 float) (f0-4 float) (f30-0 float))
(cond
((!= (-> obj amp) 0.000000)
(set! f30-0
(the float (- (-> *display* base-frame-counter) (-> obj start-time)))
)
(set! f0-2 (-> obj period))
(set! f0-4 (- f30-0 (* (the float (the int (/ f30-0 f0-2))) f0-2)))
(* (sin (/ (* 65536.000000 f0-4) (-> obj period)))
(* (-> obj amp) (/ (- (-> obj duration) f30-0) (-> obj duration)))
)
((nonzero-amplitude? obj)
(let* ((time-since-start (the float (- (-> *display* base-frame-counter) (-> obj start-time))))
(time-since-period-start (- time-since-start (* (the float (the int (/ time-since-start (-> obj period)))) (-> obj period))))
)
(* (sin (/ (* DEGREES_PER_ROT time-since-period-start) (-> obj period)))
(* (-> obj amp)
(/ (- (-> obj duration) time-since-start) (-> obj duration)))
)
)
)
(else 0.000000)
;; amplitude = 0, die.
(else 0.0)
)
)
(defmethod die-on-next-update! smush-control ((obj smush-control))
"On the next call to update!, zero everything.
Calls to get-no-update will still work."
(when (!= (-> obj amp) 0.000000)
(set! (-> obj damp-period) -1.000000)
(if (nonzero-amplitude? obj)
(set! (-> obj damp-period) -1.0)
)
obj
)
@ -124,6 +126,7 @@
(arg5 float)
)
"Activate the smush! This only activates if the ongoing smush is mostly done."
(when (>= (fabs (* 0.2 (-> obj amp)))
(fabs (get-no-update obj))
)
@ -132,7 +135,7 @@
(set! (-> obj duration) (the float arg2))
(set! (-> obj damp-amp) arg3)
(set! (-> obj damp-period) arg4)
(set! (-> obj ticks) 0.000000)
(set! (-> obj ticks) 0.0)
(set! (-> obj start-time) (-> *display* base-frame-counter))
)
obj

View file

@ -19,7 +19,7 @@
(dummy-12 (_type_ float) float 12)
(dummy-13 (_type_) float 13)
(dummy-14 (_type_ uint float float float) int 14)
(dummy-15 (_type_) float 15) ;; wip
(dummy-15 (_type_ process) float 15) ;; wip
(dummy-16 (_type_ float) float 16)
(dummy-17 (_type_) float 17)
)
@ -42,7 +42,7 @@
(dummy-12 (_type_ float) float 12)
(dummy-13 (_type_) float 13)
(dummy-14 (_type_ uint float float float) int 14)
(dummy-15 (_type_) float 15) ;; wip
(dummy-15 (_type_ process) float 15) ;; wip
;; (dummy-16 () none 16)
;; (dummy-17 () none 17)
)
@ -62,7 +62,7 @@
(dummy-12 (_type_ float) float 12)
(dummy-13 (_type_) float 13)
(dummy-14 (_type_ uint float float float) int 14)
(dummy-15 (_type_) float 15) ;; wip
(dummy-15 (_type_ process) float 15) ;; wip
;; (dummy-16 () none 16)
;; (dummy-17 () none 17)
)

View file

@ -14,9 +14,8 @@
(set! (-> obj period) arg0)
(let* ((f0-1 (the float arg0))
(f1-1 (* arg1 f0-1))
(f0-3 (- f1-1 (* (the float (the int (/ f1-1 f0-1))) f0-1)))
)
(set! (-> obj offset) f0-3)
(set! (-> obj offset) (- f1-1 (* (the float (the int (/ f1-1 f0-1))) f0-1)))
)
0
)
@ -29,9 +28,8 @@
(set! (-> obj period) arg0)
(let* ((f0-1 (the float arg0))
(f1-1 (* arg1 f0-1))
(f0-3 (- f1-1 (* (the float (the int (/ f1-1 f0-1))) f0-1)))
)
(set! (-> obj offset) f0-3)
(set! (-> obj offset) (- f1-1 (* (the float (the int (/ f1-1 f0-1))) f0-1)))
)
(if (< arg2 0.0)
(set! arg2 0.0)
@ -76,9 +74,8 @@
(set! (-> obj period) arg0)
(let* ((f0-1 (the float arg0))
(f1-1 (* arg1 f0-1))
(f0-3 (- f1-1 (* (the float (the int (/ f1-1 f0-1))) f0-1)))
)
(set! (-> obj offset) f0-3)
(set! (-> obj offset) (- f1-1 (* (the float (the int (/ f1-1 f0-1))) f0-1)))
)
(cond
((< arg2 0.0)
@ -102,22 +99,13 @@
)
;; definition for method 15 of type sync-info
;; WARN: Type Propagation failed: Could not get type of load: (set! a0 (l.wu (+ a1 48))).
;; WARN: Type Propagation failed: Type analysis failed
;; WARN: Unsupported inline assembly instruction kind - [sq r0, 16(sp)]
;; Used lq/sq
;; ERROR: function was not converted to expressions. Cannot decompile.
;; definition for method 15 of type sync-info-eased
;; WARN: Type Propagation failed: Could not get type of load: (set! a0 (l.wu (+ a1 48))).
;; WARN: Type Propagation failed: Type analysis failed
;; WARN: Unsupported inline assembly instruction kind - [sq r0, 16(sp)]
;; Used lq/sq
;; ERROR: function was not converted to expressions. Cannot decompile.
;; definition for method 15 of type sync-info-paused
;; WARN: Type Propagation failed: Could not get type of load: (set! a0 (l.wu (+ a1 48))).
;; WARN: Type Propagation failed: Type analysis failed
;; WARN: Unsupported inline assembly instruction kind - [sq r0, 16(sp)]
;; Used lq/sq
;; ERROR: function was not converted to expressions. Cannot decompile.
;; definition for method 10 of type sync-info
(defmethod dummy-10 sync-info ((obj sync-info))
@ -213,7 +201,7 @@
;; definition for method 9 of type sync-info-paused
(defmethod dummy-9 sync-info-paused ((obj sync-info-paused) (arg0 float))
(* ((method-of-type sync-info-paused dummy-11) obj) arg0)
(* (dummy-11 obj) arg0)
)
;; definition for method 13 of type sync-info
@ -354,12 +342,12 @@
;; definition for method 12 of type sync-info-eased
(defmethod dummy-12 sync-info-eased ((obj sync-info-eased) (arg0 float))
(* ((method-of-type sync-info-eased dummy-13) obj) arg0)
(* (dummy-13 obj) arg0)
)
;; definition for method 12 of type sync-info-paused
(defmethod dummy-12 sync-info-paused ((obj sync-info-paused) (arg0 float))
(* ((method-of-type sync-info-paused dummy-13) obj) arg0)
(* (dummy-13 obj) arg0)
)
;; definition for method 9 of type delayed-rand-float
@ -385,8 +373,9 @@
)
(set! (-> obj start-time) (-> *display* base-frame-counter))
(set! (-> obj timer) (rand-vu-int-range (-> obj min-time) (-> obj max-time)))
(let ((f0-3 (rand-vu-float-range (- (-> obj max-val)) (-> obj max-val))))
(set! (-> obj value) f0-3)
(set!
(-> obj value)
(rand-vu-float-range (- (-> obj max-val)) (-> obj max-val))
)
)
(-> obj value)
@ -423,10 +412,9 @@
(fmin (-> obj max-vel) (fmax (- (-> obj max-vel)) (-> obj vel)))
)
(set! (-> obj vel) (* (-> obj vel) (-> obj damping)))
(let
((f0-10 (+ (-> obj value) (* (-> obj vel) (-> *display* time-adjust-ratio))))
)
(set! (-> obj value) f0-10)
(set!
(-> obj value)
(+ (-> obj value) (* (-> obj vel) (-> *display* time-adjust-ratio)))
)
(-> obj value)
)
@ -444,7 +432,7 @@
(arg5 float)
(arg6 float)
)
((method-of-type oscillating-float dummy-9) (-> obj osc) arg0 arg4 arg5 arg6)
(dummy-9 (-> obj osc) arg0 arg4 arg5 arg6)
(set! (-> obj max-value) arg1)
(set! (-> obj min-value) arg2)
(set! (-> obj elasticity) arg3)
@ -454,23 +442,19 @@
;; definition for method 10 of type bouncing-float
(defmethod dummy-10 bouncing-float ((obj bouncing-float) (arg0 float))
((method-of-type oscillating-float dummy-10) (-> obj osc) arg0)
(dummy-10 (-> obj osc) arg0)
(set! (-> obj state) 0)
(when (>= (-> obj osc value) (-> obj max-value))
(set! (-> obj osc value) (-> obj max-value))
(if (< 0.0 (-> obj osc vel))
(let ((f0-4 (* (-> obj osc vel) (- (-> obj elasticity)))))
(set! (-> obj osc vel) f0-4)
)
(set! (-> obj osc vel) (* (-> obj osc vel) (- (-> obj elasticity))))
)
(set! (-> obj state) 1)
)
(when (>= (-> obj min-value) (-> obj osc value))
(set! (-> obj osc value) (-> obj min-value))
(if (< (-> obj osc vel) 0.0)
(let ((f0-9 (* (-> obj osc vel) (- (-> obj elasticity)))))
(set! (-> obj osc vel) f0-9)
)
(set! (-> obj osc vel) (* (-> obj osc vel) (- (-> obj elasticity))))
)
(set! (-> obj state) -1)
)
@ -500,9 +484,7 @@
(set! (-> obj y-max) (* 0.5 arg3))
(set! (-> obj start-time) (the-as uint 0))
(set! (-> obj timer) 0)
(let ((v1-0 (-> obj value)))
(.svf (&-> v1-0 quad) vf0)
)
(.svf (&-> (-> obj value) quad) vf0)
(-> obj value)
)
)
@ -512,15 +494,15 @@
(set! (-> obj start-time) (-> *display* base-frame-counter))
(set! (-> obj timer) (rand-vu-int-range (-> obj min-time) (-> obj max-time)))
(set!
(-> obj value data 0)
(-> obj value x)
(rand-vu-float-range (- (-> obj xz-max)) (-> obj xz-max))
)
(set!
(-> obj value data 1)
(-> obj value y)
(rand-vu-float-range (- (-> obj y-max)) (-> obj y-max))
)
(set!
(-> obj value data 2)
(-> obj value z)
(rand-vu-float-range (- (-> obj xz-max)) (-> obj xz-max))
)
(-> obj value)
@ -533,7 +515,7 @@
(the-as int (- (-> *display* base-frame-counter) (-> obj start-time)))
(-> obj timer)
)
((method-of-type delayed-rand-vector dummy-10) obj)
(dummy-10 obj)
)
(-> obj value)
)
@ -547,10 +529,8 @@
(the-as int (- (-> *display* base-frame-counter) (-> obj start-time)))
(-> obj timer)
)
((method-of-type delayed-rand-vector dummy-10) obj)
(let ((v1-5 (-> obj value)))
(.svf (&-> v1-5 quad) vf0)
)
(dummy-10 obj)
(.svf (&-> (-> obj value) quad) vf0)
)
(-> obj value)
)
@ -579,17 +559,11 @@
)
)
(else
(let ((v1-2 (-> obj value)))
(.svf (&-> v1-2 quad) vf0)
)
(let ((v1-3 (-> obj target)))
(.svf (&-> v1-3 quad) vf0)
)
(.svf (&-> (-> obj value) quad) vf0)
(.svf (&-> (-> obj target) quad) vf0)
)
)
(let ((v1-4 (-> obj vel)))
(.svf (&-> v1-4 quad) vf0)
)
(.svf (&-> (-> obj vel) quad) vf0)
(set! (-> obj max-vel) arg2)
(set! (-> obj damping) arg3)
(set! (-> obj accel) arg1)
@ -607,7 +581,7 @@
(vf6 :class vf)
)
(init-vf0-vector)
(let ((s5-0 (new 'stack 'vector)))
(let ((s5-0 (new 'stack-no-clear 'vector)))
(cond
(arg0
(let ((a0-1 s5-0))
@ -670,7 +644,7 @@
(.svf (&-> a1-4 quad) vf6)
)
(let ((f0-2 (vector-length (-> obj vel))))
(if (< (-> obj max-vel) f0-2)
(when (< (-> obj max-vel) f0-2)
(let ((v1-6 (-> obj vel)))
(let ((a0-8 (-> obj vel))
(f0-3 (/ (-> obj max-vel) f0-2))

View file

@ -60,13 +60,13 @@
"Convert number to seconds unit."
(cond
((float? x)
(* (* 1.0 TICKS_PER_SECOND) x)
(* 1.0 TICKS_PER_SECOND x)
)
((integer? x)
(* TICKS_PER_SECOND x)
)
(#t
`(* (* 1.0 TICKS_PER_SECOND) ,x)
`(* 1.0 TICKS_PER_SECOND ,x)
)
)
)

View file

@ -22,7 +22,7 @@
(defmacro md (file &rest path)
"Make Debug: make + print disassembly for a file"
`(asm-file ,file :color :write :disassemble ,@path)
`(asm-file ,file :color :write :disassemble ,(first path))
)
(defmacro ml (file)
@ -355,7 +355,7 @@
(defmacro case (switch &rest cases)
"A switch-case construct. switch is saved onto a local variable and compared against each case, sequentially.
else can be used as the default case, but it must be the last one."
else can be used like the 'default' case, but it must be the last one."
(with-gensyms (sw)
;; save the switch to a variable (only evaluated once)
@ -407,16 +407,20 @@
`(set! ,place (+ 1 ,place))
)
(defmacro 1- (var)
`(- ,var 1)
)
(defmacro -! (place amount)
`(set! ,place (- ,place ,amount))
)
(defmacro *! (place amount)
`(set! ,place (* ,place ,amount))
(defmacro 1-! (place)
`(set! ,place (- 1 ,place))
)
(defmacro 1- (var)
`(- ,var 1)
(defmacro *! (place amount)
`(set! ,place (* ,place ,amount))
)
(defmacro zero? (thing)

View file

@ -27,7 +27,7 @@ There are several ways to "go"
and shrink the process heap, if appropriate
- go from outside the process. You can temporarily set pp to another process, and have that
process go to another state. The actually go will occur the next time the process is scheduled.
process go to another state. The actual go will occur the next time the process is scheduled.
Use the go-process macro to do this.
- go from a non-main thread in the right process. You can do a go from a temporary thread, like trans or post.

View file

@ -16,7 +16,7 @@
(dummy-12 (_type_ float) float 12)
(dummy-13 (_type_) float 13)
(dummy-14 (_type_ uint float float float) int 14)
(dummy-15 (_type_) float 15)
(dummy-15 (_type_ process) float 15)
(dummy-16 (_type_ float) float 16)
(dummy-17 (_type_) float 17)
)
@ -234,3 +234,6 @@
(let ((v0-8 0))
)