mirror of
https://github.com/open-goal/jak-project
synced 2026-09-07 03:30:01 -04:00
[decomp] prototype-h, a few enums and other random things (#422)
* [decompiler] fix missing error in asm output * decomp prototype-h, cleanup pat-h and res-h, prep for fact-h & res * fix types * Update all-types.gc * fix a methos in `res-h`
This commit is contained in:
@@ -6,36 +6,42 @@
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
(deftype res-tag (uint128)
|
||||
()
|
||||
:flag-assert #x900000010
|
||||
((unk0 uint32 :offset 0 :size 32)
|
||||
(unk1 uint16 :offset 32 :size 16)
|
||||
(unk2 uint64 :offset 64 :size 64)
|
||||
)
|
||||
:flag-assert #x900000010
|
||||
)
|
||||
|
||||
(deftype res-lump (basic)
|
||||
((length int32 :offset-assert 4)
|
||||
(allocated-length int32 :offset-assert 8)
|
||||
(data-base pointer :offset-assert 12)
|
||||
(data-top pointer :offset-assert 16)
|
||||
(data-size int32 :offset-assert 20)
|
||||
(extra basic :offset-assert 24)
|
||||
(tag uint32 :offset-assert 28)
|
||||
((length int32 :offset-assert 4)
|
||||
(allocated-length int32 :offset-assert 8)
|
||||
(data-base pointer :offset-assert 12)
|
||||
(data-top pointer :offset-assert 16)
|
||||
(data-size int32 :offset-assert 20)
|
||||
(extra basic :offset-assert 24)
|
||||
(tag (pointer res-tag) :offset-assert 28)
|
||||
)
|
||||
:method-count-assert 22
|
||||
:size-assert #x20
|
||||
:flag-assert #x1600000020
|
||||
;; field extra is a basic loaded with a signed load
|
||||
;; field extra is a basic loaded with a signed load
|
||||
(:methods
|
||||
(dummy-9 () none 9)
|
||||
(dummy-10 () none 10)
|
||||
(dummy-11 () none 11)
|
||||
(dummy-12 () none 12)
|
||||
(dummy-13 () none 13)
|
||||
(dummy-14 () none 14)
|
||||
(dummy-15 () none 15)
|
||||
(dummy-16 () none 16)
|
||||
(dummy-17 () none 17)
|
||||
(dummy-18 () none 18)
|
||||
(dummy-19 () none 19)
|
||||
(dummy-20 () none 20)
|
||||
(dummy-21 () none 21)
|
||||
(new (symbol type int int) _type_ 0)
|
||||
(dummy-9 (_type_ symbol symbol int symbol (pointer res-tag) pointer) symbol 9)
|
||||
(dummy-10 (_type_ symbol symbol int symbol symbol pointer) int 10)
|
||||
(dummy-11 (_type_ symbol symbol int int symbol pointer) int 11)
|
||||
(dummy-12 (_type_ symbol symbol int int symbol pointer) float 12)
|
||||
(dummy-13 (_type_ int) pointer 13) ;; advance tag pointer
|
||||
(dummy-14 (_type_ uint) pointer 14)
|
||||
(dummy-15 (_type_) none 15)
|
||||
(dummy-16 (_type_ int int int int) none 16)
|
||||
(dummy-17 (_type_ int int) res-lump 17)
|
||||
(dummy-18 (_type_ int int) none 18)
|
||||
(dummy-19 (_type_ symbol symbol int) int 19)
|
||||
(dummy-20 (_type_ int int) none 20)
|
||||
(dummy-21 (_type_ int int int int int) none 21)
|
||||
)
|
||||
)
|
||||
|
||||
(define *res-key-string* (new 'global 'string 64 (the-as string #f)))
|
||||
|
||||
@@ -48,27 +48,38 @@
|
||||
)
|
||||
)
|
||||
|
||||
(defun pickup-type->string ((arg0 int))
|
||||
(local-vars (v1-0 int))
|
||||
(set! v1-0 arg0)
|
||||
(cond
|
||||
((= v1-0 9) "eco-pill-random")
|
||||
((= v1-0 8) "buzzer")
|
||||
((= v1-0 7) "eco-pill")
|
||||
((= v1-0 6) "fuel-cell")
|
||||
((= v1-0 5) "money")
|
||||
((= v1-0 4) "eco-green")
|
||||
((= v1-0 3) "eco-blue")
|
||||
((= v1-0 2) "eco-red")
|
||||
((= v1-0 1) "eco-yellow")
|
||||
((zero? v1-0) "none")
|
||||
(else "*unknown*")
|
||||
)
|
||||
(defenum pickup-type
|
||||
(none)
|
||||
(eco-yellow)
|
||||
(eco-red)
|
||||
(eco-blue)
|
||||
(eco-green)
|
||||
(money)
|
||||
(fuel-cell)
|
||||
(eco-pill)
|
||||
(buzzer)
|
||||
(eco-pill-random)
|
||||
)
|
||||
|
||||
(defun pickup-type->string ((arg0 pickup-type))
|
||||
(case arg0
|
||||
((pickup-type eco-pill-random) "eco-pill-random")
|
||||
((pickup-type buzzer) "buzzer")
|
||||
((pickup-type eco-pill) "eco-pill")
|
||||
((pickup-type fuel-cell) "fuel-cell")
|
||||
((pickup-type money) "money")
|
||||
((pickup-type eco-green) "eco-green")
|
||||
((pickup-type eco-blue) "eco-blue")
|
||||
((pickup-type eco-red) "eco-red")
|
||||
((pickup-type eco-yellow) "eco-yellow")
|
||||
((pickup-type none) "none")
|
||||
(else "*unknown*")
|
||||
)
|
||||
)
|
||||
|
||||
(deftype fact-info (basic)
|
||||
((process basic :offset-assert 4)
|
||||
(pickup-type int32 :offset-assert 8)
|
||||
((process process :offset-assert 4)
|
||||
(pickup-type pickup-type :offset-assert 8)
|
||||
(pickup-amount float :offset-assert 12)
|
||||
(pickup-spawn-amount float :offset-assert 16)
|
||||
(options uint64 :offset-assert 24)
|
||||
@@ -78,9 +89,10 @@
|
||||
:size-assert #x28
|
||||
:flag-assert #xc00000028
|
||||
(:methods
|
||||
(new (symbol type process pickup-type float) _type_ 0)
|
||||
(dummy-9 () none 9)
|
||||
(dummy-10 () none 10)
|
||||
(dummy-11 () none 11)
|
||||
(dummy-11 (_type_) none 11)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -106,11 +118,6 @@
|
||||
:method-count-assert 12
|
||||
:size-assert #x90
|
||||
:flag-assert #xc00000090
|
||||
(:methods
|
||||
(dummy-9 () none 9)
|
||||
(dummy-10 () none 10)
|
||||
(dummy-11 () none 11)
|
||||
)
|
||||
)
|
||||
|
||||
(deftype fact-info-enemy (fact-info)
|
||||
@@ -125,9 +132,4 @@
|
||||
:method-count-assert 12
|
||||
:size-assert #x44
|
||||
:flag-assert #xc00000044
|
||||
(:methods
|
||||
(dummy-9 () none 9)
|
||||
(dummy-10 () none 10)
|
||||
(dummy-11 () none 11)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -77,19 +77,19 @@
|
||||
)
|
||||
|
||||
(deftype continue-point (basic)
|
||||
((name basic :offset-assert 4)
|
||||
(level basic :offset-assert 8)
|
||||
(flags uint32 :offset-assert 12)
|
||||
(trans vector :inline :offset-assert 16)
|
||||
(quat vector :inline :offset-assert 32)
|
||||
(camera-trans vector :inline :offset-assert 48)
|
||||
(camera-rot float 9 :offset-assert 64)
|
||||
((name basic :offset-assert 4)
|
||||
(level basic :offset-assert 8)
|
||||
(flags uint32 :offset-assert 12)
|
||||
(trans vector :inline :offset-assert 16)
|
||||
(quat vector :inline :offset-assert 32)
|
||||
(camera-trans vector :inline :offset-assert 48)
|
||||
(camera-rot float 9 :offset-assert 64)
|
||||
(load-commands pair :offset-assert 100)
|
||||
(vis-nick basic :offset-assert 104)
|
||||
(lev0 basic :offset-assert 108)
|
||||
(disp0 basic :offset-assert 112)
|
||||
(lev1 basic :offset-assert 116)
|
||||
(disp1 basic :offset-assert 120)
|
||||
(vis-nick basic :offset-assert 104)
|
||||
(lev0 basic :offset-assert 108)
|
||||
(disp0 basic :offset-assert 112)
|
||||
(lev1 basic :offset-assert 116)
|
||||
(disp1 basic :offset-assert 120)
|
||||
)
|
||||
:method-count-assert 10
|
||||
:size-assert #x7c
|
||||
@@ -100,50 +100,50 @@
|
||||
)
|
||||
|
||||
(deftype game-info (basic)
|
||||
((mode basic :offset-assert 4)
|
||||
(save-name basic :offset-assert 8)
|
||||
(life float :offset-assert 12)
|
||||
(life-max float :offset-assert 16)
|
||||
(money float :offset-assert 20)
|
||||
(money-total float :offset-assert 24)
|
||||
(money-per-level uint8 32 :offset-assert 28)
|
||||
(deaths-per-level uint8 32 :offset-assert 60)
|
||||
(buzzer-total float :offset-assert 92)
|
||||
(fuel float :offset-assert 96)
|
||||
(perm-list basic :offset-assert 100)
|
||||
(task-perm-list basic :offset-assert 104)
|
||||
(current-continue basic :offset-assert 108)
|
||||
(text-ids-seen basic :offset-assert 112)
|
||||
(level-opened uint8 32 :offset-assert 116)
|
||||
(hint-control basic :offset-assert 148)
|
||||
(task-hint-control basic :offset-assert 152)
|
||||
(total-deaths int32 :offset-assert 156)
|
||||
(continue-deaths int32 :offset-assert 160)
|
||||
(fuel-cell-deaths int32 :offset-assert 164)
|
||||
(game-start-time uint64 :offset-assert 168)
|
||||
(continue-time uint64 :offset-assert 176)
|
||||
(death-time uint64 :offset-assert 184)
|
||||
(hit-time uint64 :offset-assert 192)
|
||||
(fuel-cell-pickup-time uint64 :offset-assert 200)
|
||||
(fuel-cell-time basic :offset-assert 208)
|
||||
(enter-level-time basic :offset-assert 212)
|
||||
(in-level-time basic :offset-assert 216)
|
||||
(blackout-time uint64 :offset-assert 224)
|
||||
(letterbox-time uint64 :offset-assert 232)
|
||||
(hint-play-time uint64 :offset-assert 240)
|
||||
(display-text-time uint64 :offset-assert 248)
|
||||
(display-text-handle uint64 :offset-assert 256)
|
||||
(death-movie-tick int32 :offset-assert 264)
|
||||
(want-auto-save basic :offset-assert 268)
|
||||
(auto-save-proc uint64 :offset-assert 272)
|
||||
(auto-save-status uint32 :offset-assert 280)
|
||||
(auto-save-card int32 :offset-assert 284)
|
||||
(auto-save-which int32 :offset-assert 288)
|
||||
(pov-camera-handle uint64 :offset-assert 296)
|
||||
(other-camera-handle uint64 :offset-assert 304)
|
||||
(death-pos basic :offset-assert 312)
|
||||
(dummy basic :offset-assert 316)
|
||||
(auto-save-count int32 :offset-assert 320)
|
||||
((mode basic :offset-assert 4)
|
||||
(save-name basic :offset-assert 8)
|
||||
(life float :offset-assert 12)
|
||||
(life-max float :offset-assert 16)
|
||||
(money float :offset-assert 20)
|
||||
(money-total float :offset-assert 24)
|
||||
(money-per-level uint8 32 :offset-assert 28)
|
||||
(deaths-per-level uint8 32 :offset-assert 60)
|
||||
(buzzer-total float :offset-assert 92)
|
||||
(fuel float :offset-assert 96)
|
||||
(perm-list basic :offset-assert 100)
|
||||
(task-perm-list basic :offset-assert 104)
|
||||
(current-continue basic :offset-assert 108)
|
||||
(text-ids-seen basic :offset-assert 112)
|
||||
(level-opened uint8 32 :offset-assert 116)
|
||||
(hint-control basic :offset-assert 148)
|
||||
(task-hint-control basic :offset-assert 152)
|
||||
(total-deaths int32 :offset-assert 156)
|
||||
(continue-deaths int32 :offset-assert 160)
|
||||
(fuel-cell-deaths int32 :offset-assert 164)
|
||||
(game-start-time uint64 :offset-assert 168)
|
||||
(continue-time uint64 :offset-assert 176)
|
||||
(death-time uint64 :offset-assert 184)
|
||||
(hit-time uint64 :offset-assert 192)
|
||||
(fuel-cell-pickup-time uint64 :offset-assert 200)
|
||||
(fuel-cell-time basic :offset-assert 208)
|
||||
(enter-level-time basic :offset-assert 212)
|
||||
(in-level-time basic :offset-assert 216)
|
||||
(blackout-time uint64 :offset-assert 224)
|
||||
(letterbox-time uint64 :offset-assert 232)
|
||||
(hint-play-time uint64 :offset-assert 240)
|
||||
(display-text-time uint64 :offset-assert 248)
|
||||
(display-text-handle uint64 :offset-assert 256)
|
||||
(death-movie-tick int32 :offset-assert 264)
|
||||
(want-auto-save basic :offset-assert 268)
|
||||
(auto-save-proc uint64 :offset-assert 272)
|
||||
(auto-save-status uint32 :offset-assert 280)
|
||||
(auto-save-card int32 :offset-assert 284)
|
||||
(auto-save-which int32 :offset-assert 288)
|
||||
(pov-camera-handle uint64 :offset-assert 296)
|
||||
(other-camera-handle uint64 :offset-assert 304)
|
||||
(death-pos basic :offset-assert 312)
|
||||
(dummy basic :offset-assert 316)
|
||||
(auto-save-count int32 :offset-assert 320)
|
||||
)
|
||||
:method-count-assert 29
|
||||
:size-assert #x144
|
||||
@@ -174,7 +174,6 @@
|
||||
)
|
||||
|
||||
(define-extern *game-info* game-info)
|
||||
|
||||
(when (or (not *game-info*) (zero? *game-info*))
|
||||
(let ((temp (new 'static 'game-info :mode 'debug :current-continue #f)))
|
||||
(set! (-> temp fuel-cell-time) (new 'global 'boxed-array uint64 116))
|
||||
|
||||
@@ -5,3 +5,107 @@
|
||||
;; name in dgo: prototype-h
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
(deftype prototype-bucket (basic)
|
||||
((name basic :offset-assert 4)
|
||||
(flags uint32 :offset-assert 8)
|
||||
(in-level uint16 :offset-assert 12)
|
||||
(utextures uint16 :offset-assert 14)
|
||||
(geometry uint32 4 :offset-assert 16)
|
||||
(dists vector :inline :offset-assert 32)
|
||||
(rdists vector :inline :offset-assert 48)
|
||||
(next uint32 4 :offset-assert 64)
|
||||
(count uint16 4 :offset-assert 80)
|
||||
(near-plane float :offset 32)
|
||||
(near-stiff float :offset 36)
|
||||
(mid-plane float :offset 40)
|
||||
(far-plane float :offset 44)
|
||||
(rlength-near float :offset 48)
|
||||
(rlength-stiff float :offset 52)
|
||||
(rlength-mid float :offset 56)
|
||||
(stiffness float :offset 60)
|
||||
(next-clear uint128 :offset 64)
|
||||
(count-clear uint64 :offset 80)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x58
|
||||
:flag-assert #x900000058
|
||||
)
|
||||
|
||||
(deftype prototype-bucket-shrub (prototype-bucket)
|
||||
((mod-count uint16 4 :offset-assert 88)
|
||||
(last uint32 4 :offset-assert 96)
|
||||
(last-clear uint128 :offset 96)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x70
|
||||
:flag-assert #x900000070
|
||||
)
|
||||
|
||||
(deftype prototype-inline-array-shrub (drawable)
|
||||
((length int16 :offset 6)
|
||||
(data prototype-bucket-shrub 1 :inline :offset 32)
|
||||
(_pad uint32 :offset-assert 144)
|
||||
)
|
||||
:method-count-assert 18
|
||||
:size-assert #x94
|
||||
:flag-assert #x1200000094
|
||||
)
|
||||
|
||||
(deftype prototype-array-shrub-info (basic)
|
||||
((prototype-inline-array-shrub basic :offset-assert 4)
|
||||
(wind-vectors uint32 :offset-assert 8)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #xc
|
||||
:flag-assert #x90000000c
|
||||
)
|
||||
|
||||
(deftype prototype-bucket-tie (prototype-bucket)
|
||||
((generic-count uint16 4 :offset-assert 88)
|
||||
(generic-next uint32 4 :offset-assert 96)
|
||||
(frag-count uint8 4 :offset-assert 112)
|
||||
(index-start uint8 4 :offset-assert 116)
|
||||
(base-qw uint16 4 :offset-assert 120)
|
||||
(envmap-rfade float :offset-assert 128)
|
||||
(envmap-fade-far float :offset-assert 132)
|
||||
(envmap-shader adgif-shader :offset-assert 136)
|
||||
(collide-frag basic :offset-assert 140)
|
||||
(tie-colors basic :offset-assert 144)
|
||||
(data uint32 :dynamic :offset-assert 148)
|
||||
(color-index-qwc uint32 :dynamic :offset-assert 148)
|
||||
(generic-next-clear uint128 :offset 96)
|
||||
(generic-count-clear uint128 :offset 80)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x94
|
||||
:flag-assert #x900000094
|
||||
)
|
||||
|
||||
(deftype prototype-array-tie (array)
|
||||
()
|
||||
:method-count-assert 10
|
||||
:size-assert #x10
|
||||
:flag-assert #xa00000010
|
||||
(:methods
|
||||
(dummy-9 () none 9)
|
||||
)
|
||||
)
|
||||
|
||||
(deftype proxy-prototype-array-tie (basic)
|
||||
((prototype-array-tie basic :offset-assert 4)
|
||||
(wind-vectors uint32 :offset-assert 8)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #xc
|
||||
:flag-assert #x90000000c
|
||||
)
|
||||
|
||||
(deftype instance (drawable)
|
||||
((bucket-index uint16 :offset 6)
|
||||
(origin matrix4h :inline :offset-assert 32)
|
||||
(wind-index uint16 :offset 62)
|
||||
)
|
||||
:method-count-assert 18
|
||||
:size-assert #x40
|
||||
:flag-assert #x1200000040
|
||||
)
|
||||
|
||||
@@ -45,6 +45,6 @@
|
||||
(the int (-> arg0 data 2))
|
||||
(the-as int (-> *wind-work* wind-time))
|
||||
)
|
||||
63
|
||||
#x3f
|
||||
)
|
||||
)
|
||||
|
||||
+123
-90
@@ -5,120 +5,153 @@
|
||||
;; name in dgo: pat-h
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
(defenum pat-material
|
||||
:type uint8
|
||||
(stone)
|
||||
(ice)
|
||||
(quicksand)
|
||||
(waterbottom)
|
||||
(tar)
|
||||
(sand)
|
||||
(wood)
|
||||
(grass)
|
||||
(pcmetal)
|
||||
(snow)
|
||||
(deepsnow)
|
||||
(hotcoals)
|
||||
(lava)
|
||||
(crwood)
|
||||
(gravel)
|
||||
(dirt)
|
||||
(metal)
|
||||
(straw)
|
||||
(tube)
|
||||
(swamp)
|
||||
(stopproj)
|
||||
(rotate)
|
||||
(neutral)
|
||||
)
|
||||
|
||||
(defenum pat-mode
|
||||
:type uint8
|
||||
(ground)
|
||||
(wall)
|
||||
(obstacle)
|
||||
)
|
||||
|
||||
(defenum pat-event
|
||||
:type uint8
|
||||
(none)
|
||||
(deadly)
|
||||
(endlessfall)
|
||||
(burn)
|
||||
(deadlyup)
|
||||
(burnup)
|
||||
(melt)
|
||||
)
|
||||
|
||||
(deftype pat-surface (uint32)
|
||||
()
|
||||
((skip uint8 :offset 0 :size 3)
|
||||
(mode pat-mode :offset 3 :size 3)
|
||||
(material pat-material :offset 6 :size 6)
|
||||
(camera uint8 :offset 12 :size 2)
|
||||
(event pat-event :offset 14 :size 6)
|
||||
(noentity uint8 :offset 0 :size 1)
|
||||
(nocamera uint8 :offset 1 :size 1)
|
||||
(noedge uint8 :offset 2 :size 1)
|
||||
(nolineofsight uint8 :offset 12 :size 1)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x4
|
||||
:flag-assert #x900000004
|
||||
)
|
||||
|
||||
(defmethod inspect pat-surface ((obj pat-surface))
|
||||
(format #t "[~8x] ~A~%" obj 'pat-surface)
|
||||
(format #t "~Tskip: ~D~%" (shr (shl (the-as int obj) 61) 61))
|
||||
(format #t "~Tmode: ~D~%" (shr (shl (the-as int obj) 58) 61))
|
||||
(format #t "~Tmaterial: ~D~%" (shr (shl (the-as int obj) 52) 58))
|
||||
(format #t "~Tcamera: ~D~%" (shr (shl (the-as int obj) 50) 62))
|
||||
(format #t "~Tevent: ~D~%" (shr (shl (the-as int obj) 44) 58))
|
||||
(format #t "~Tnoentity: ~D~%" (shr (shl (the-as int obj) 63) 63))
|
||||
(format #t "~Tnocamera: ~D~%" (shr (shl (the-as int obj) 62) 63))
|
||||
(format #t "~Tnoedge: ~D~%" (shr (shl (the-as int obj) 61) 63))
|
||||
(format #t "~Tnolineofsight: ~D~%" (shr (shl (the-as int obj) 51) 63))
|
||||
obj
|
||||
)
|
||||
|
||||
(defun-debug pat-material->string ((arg0 pat-surface))
|
||||
(local-vars (v1-1 int))
|
||||
(set! v1-1 (shr (shl (the-as int arg0) 52) 58))
|
||||
(cond
|
||||
((= v1-1 22) "neutral")
|
||||
((= v1-1 21) "rotate")
|
||||
((= v1-1 20) "stopproj")
|
||||
((= v1-1 19) "swamp")
|
||||
((= v1-1 18) "tube")
|
||||
((= v1-1 17) "straw")
|
||||
((= v1-1 16) "metal")
|
||||
((= v1-1 15) "dirt")
|
||||
((= v1-1 14) "gravel")
|
||||
((= v1-1 13) "crwood")
|
||||
((= v1-1 12) "lava")
|
||||
((= v1-1 11) "hotcoals")
|
||||
((= v1-1 10) "deepsnow")
|
||||
((= v1-1 9) "snow")
|
||||
((= v1-1 8) "pcmetal")
|
||||
((= v1-1 7) "grass")
|
||||
((= v1-1 6) "wood")
|
||||
((= v1-1 5) "sand")
|
||||
((= v1-1 4) "tar")
|
||||
((= v1-1 3) "waterbottom")
|
||||
((= v1-1 2) "quicksand")
|
||||
((= v1-1 1) "ice")
|
||||
((zero? v1-1) "stone")
|
||||
(defun-debug pat-material->string ((pat pat-surface))
|
||||
(case (-> pat material)
|
||||
((pat-material neutral) "neutral")
|
||||
((pat-material rotate) "rotate")
|
||||
((pat-material stopproj) "stopproj")
|
||||
((pat-material swamp) "swamp")
|
||||
((pat-material tube) "tube")
|
||||
((pat-material straw) "straw")
|
||||
((pat-material metal) "metal")
|
||||
((pat-material dirt) "dirt")
|
||||
((pat-material gravel) "gravel")
|
||||
((pat-material crwood) "crwood")
|
||||
((pat-material lava) "lava")
|
||||
((pat-material hotcoals) "hotcoals")
|
||||
((pat-material deepsnow) "deepsnow")
|
||||
((pat-material snow) "snow")
|
||||
((pat-material pcmetal) "pcmetal")
|
||||
((pat-material grass) "grass")
|
||||
((pat-material wood) "wood")
|
||||
((pat-material sand) "sand")
|
||||
((pat-material tar) "tar")
|
||||
((pat-material waterbottom) "waterbottom")
|
||||
((pat-material quicksand) "quicksand")
|
||||
((pat-material ice) "ice")
|
||||
((pat-material stone) "stone")
|
||||
(else "*unknown*")
|
||||
)
|
||||
)
|
||||
|
||||
(defun-debug pat-mode->string ((arg0 pat-surface))
|
||||
(local-vars (v1-1 int))
|
||||
(set! v1-1 (shr (shl (the-as int arg0) 58) 61))
|
||||
(cond
|
||||
((= v1-1 2) "obstacle")
|
||||
((= v1-1 1) "wall")
|
||||
((zero? v1-1) "ground")
|
||||
(defun-debug pat-mode->string ((pat pat-surface))
|
||||
(case (-> pat mode)
|
||||
((pat-mode obstacle) "obstacle")
|
||||
((pat-mode wall) "wall")
|
||||
((pat-mode ground) "ground")
|
||||
(else "*unknown*")
|
||||
)
|
||||
)
|
||||
|
||||
(defun pat-event->string ((arg0 pat-surface))
|
||||
(local-vars (v1-1 int))
|
||||
(set! v1-1 (shr (shl (the-as int arg0) 44) 58))
|
||||
(cond
|
||||
((= v1-1 6) "melt")
|
||||
((= v1-1 5) "burnup")
|
||||
((= v1-1 4) "deadlyup")
|
||||
((= v1-1 3) "burn")
|
||||
((= v1-1 2) "endlessfall")
|
||||
((= v1-1 1) "deadly")
|
||||
((zero? v1-1) "none")
|
||||
(defun-debug pat-event->string ((pat pat-surface))
|
||||
(case (-> pat event)
|
||||
((pat-event melt) "melt")
|
||||
((pat-event burnup) "burnup")
|
||||
((pat-event deadlyup) "deadlyup")
|
||||
((pat-event burn) "burn")
|
||||
((pat-event endlessfall) "endlessfall")
|
||||
((pat-event deadly) "deadly")
|
||||
((pat-event none) "none")
|
||||
(else "*unknown*")
|
||||
)
|
||||
)
|
||||
|
||||
(deftype pat-mode-info (structure)
|
||||
((name basic :offset-assert 0)
|
||||
((name string :offset-assert 0)
|
||||
(wall-angle float :offset-assert 4)
|
||||
(color uint32 :offset-assert 8)
|
||||
(hilite-color uint32 :offset-assert 12)
|
||||
(color rgba :offset-assert 8)
|
||||
(hilite-color rgba :offset-assert 12)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x10
|
||||
:flag-assert #x900000010
|
||||
)
|
||||
|
||||
(define *pat-mode-info*
|
||||
(new 'static 'inline-array pat-mode-info 4
|
||||
(new 'static 'pat-mode-info
|
||||
:name "ground"
|
||||
:wall-angle (the-as float #x3e4ccccd)
|
||||
:color #x4000007f
|
||||
:hilite-color #x800000ff
|
||||
)
|
||||
(new 'static 'pat-mode-info
|
||||
:name "wall"
|
||||
:wall-angle 2.000000
|
||||
:color #x407f0000
|
||||
:hilite-color #x80ff0000
|
||||
)
|
||||
(new 'static 'pat-mode-info
|
||||
:name "obstacle"
|
||||
:wall-angle (the-as float #x3f51eb85)
|
||||
:color #x407f007f
|
||||
:hilite-color #x80ff00ff
|
||||
)
|
||||
(new 'static 'pat-mode-info
|
||||
:name "pole"
|
||||
:wall-angle 2.000000
|
||||
:color #x40007f7f
|
||||
:hilite-color #x8000ffff
|
||||
)
|
||||
)
|
||||
(define *pat-mode-info* (new 'static 'inline-array pat-mode-info 4
|
||||
(new 'static 'pat-mode-info
|
||||
:name "ground"
|
||||
:wall-angle 0.2
|
||||
:color (new 'static 'rgba :r #x7f :a #x40)
|
||||
:hilite-color (new 'static 'rgba :r #xff :a #x80)
|
||||
)
|
||||
(new 'static 'pat-mode-info
|
||||
:name "wall"
|
||||
:wall-angle 2.0
|
||||
:color (new 'static 'rgba :b #x7f :a #x40)
|
||||
:hilite-color (new 'static 'rgba :b #xff :a #x80)
|
||||
)
|
||||
(new 'static 'pat-mode-info
|
||||
:name "obstacle"
|
||||
:wall-angle 0.82
|
||||
:color (new 'static 'rgba :r #x7f :b #x7f :a #x40)
|
||||
:hilite-color (new 'static 'rgba :r #xff :b #xff :a #x80)
|
||||
)
|
||||
(new 'static 'pat-mode-info
|
||||
:name "pole"
|
||||
:wall-angle 2.0
|
||||
:color (new 'static 'rgba :r #x7f :g #x7f :a #x40)
|
||||
:hilite-color (new 'static 'rgba :r #xff :g #xff :a #x80)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user