update old credits & racer code

This commit is contained in:
ManDude
2022-04-16 19:00:23 +01:00
parent d2456a5c75
commit f732dd3885
4 changed files with 91 additions and 132 deletions
@@ -2130,6 +2130,11 @@
"generic-vu0": [["L1", "vu-function"]],
"shrubbery": [["L133", "vu-function"]],
"credits": [
["L32", "(array int32)"],
["L33", "(array float)"]
],
// please do not add things after this entry! git is dumb.
"object-file-that-doesnt-actually-exist-and-i-just-put-this-here-to-prevent-merge-conflicts-with-this-file": []
}
+80 -94
View File
@@ -5,48 +5,40 @@
;; name in dgo: credits
;; dgos: GAME, ENGINE
;; definition for function set-credits-font-color
;; INFO: Return type mismatch int vs none.
;; DECOMP BEGINS
(defun set-credits-font-color ((arg0 float))
(let ((f0-0 255.0))
)
255.0
(dotimes (v1-0 4)
(let ((f0-2 (* 64.0 arg0)))
(if (< 128.0 f0-2)
(set! f0-2 128.0)
)
(set! (-> *font-work* color-table 32 color v1-0 r) (the int f0-2))
(let ((f0-2 (* 64.0 arg0)))
(if (< 128.0 f0-2)
(set! f0-2 128.0)
)
(set! (-> *font-work* color-table 32 color v1-0 r) (the int f0-2))
)
(let ((f0-5 (* 64.0 arg0)))
(if (< 128.0 f0-5)
(set! f0-5 128.0)
)
(set! (-> *font-work* color-table 32 color v1-0 g) (the int f0-5))
)
(let ((f0-8 (* 64.0 arg0)))
(if (< 128.0 f0-8)
(set! f0-8 128.0)
)
(set! (-> *font-work* color-table 32 color v1-0 b) (the int f0-8))
)
)
(let ((f0-5 (* 64.0 arg0)))
(if (< 128.0 f0-5)
(set! f0-5 128.0)
)
(set! (-> *font-work* color-table 32 color v1-0 g) (the int f0-5))
)
(let ((f0-8 (* 64.0 arg0)))
(if (< 128.0 f0-8)
(set! f0-8 128.0)
)
(set! (-> *font-work* color-table 32 color v1-0 b) (the int f0-8))
)
)
0
(none)
)
;; definition for symbol *title-credits-scale*, type (array float)
(define *title-credits-scale*
(the-as (array float)
(new 'static 'boxed-array :type float :length 8
0.9 0.9 0.6 0.6 1.0 0.9 1.1 0.9)
)
(new 'static 'boxed-array :type float :length 8 :allocated-length 8 0.9 0.9 0.6 0.6 1.0 0.9 1.1 0.9)
)
;; definition for symbol *title-credits-spacing*, type (array int32)
(define *title-credits-spacing*
(the-as (array int32)
(new 'static 'boxed-array :type int32 :length 8
15 20 15 15 20 15 20 15)
)
(new 'static 'boxed-array :type int32 :length 8 :allocated-length 8 15 20 15 15 20 15 20 15)
)
(defun draw-title-credits ((arg0 float))
@@ -54,14 +46,8 @@
(let* ((s4-0 11)
(f30-0 (* arg0 (the float (+ s4-0 -2))))
(s5-0 (the int f30-0))
(gp-0 (new 'stack 'font-context
*font-default-matrix*
0
0
0.0
(font-color default)
(font-flags shadow kerning)
)
(gp-0
(new 'stack 'font-context *font-default-matrix* 0 0 0.0 (font-color default) (font-flags shadow kerning))
)
)
1.0
@@ -87,19 +73,19 @@
128.0
)
(else
(* 128.0 (- 1.0 (* 1.25 (+ -2.2 f0-10))))
)
(* 128.0 (- 1.0 (* 1.25 (+ -2.2 f0-10))))
)
)
)
)
)
(set! (-> gp-0 origin x) -44.0)
(set! (-> gp-0 origin y) 90.0)
(dotimes (s4-1 3)
(let* ((s2-0 (+ (+ s4-1 3840) s5-1))
(let* ((s2-0 (+ s4-1 3840 s5-1))
(s3-0 (lookup-text! *common-text* (the-as game-text-id s2-0) #t))
)
(when (= s2-0 3841)
(case (scf-get-territory)
(case (scf-get-territory)
((1)
(set! s3-0 (lookup-text! *common-text* (game-text-id europe) #t))
)
@@ -115,11 +101,7 @@
(print-game-text s3-0 gp-0 #f (the int f30-1) 22)
)
)
(set! (-> gp-0 origin y)
(+ (-> gp-0 origin y)
(the float (-> *title-credits-spacing* (+ s5-1 s4-1)))
)
)
(+! (-> gp-0 origin y) (the float (-> *title-credits-spacing* (+ s5-1 s4-1))))
)
)
)
@@ -130,55 +112,59 @@
(none)
)
;; definition for function draw-end-credits
(defun draw-end-credits ((arg0 int))
(local-vars (v1-13 int))
(let ((s4-0 (+ (- arg0) (the int (* 1.5 (the float (-> *video-parms* screen-sy))))))
(gp-0 2815)
(s3-0 0)
(s2-0 #t)
(s5-0 (new 'stack 'font-context *font-default-matrix* 31 0 0.0 (font-color default) (font-flags shadow kerning)))
)
(let ((v1-2 s5-0))
(set! (-> v1-2 width) (the float 450))
)
(let ((v1-3 s5-0))
(set! (-> v1-3 height) (the float 10))
)
(let ((v1-4 s5-0))
(set! (-> v1-4 scale) 1.0)
)
(set! (-> s5-0 flags) (font-flags shadow kerning middle large))
(while (or s2-0 (and (< s4-0 (- s3-0)) (< (the-as uint gp-0) (the-as uint 3249))))
(+! s4-0 s3-0)
(+! gp-0 1)
(let ((a0-8 (lookup-text! *common-text* (the-as game-text-id gp-0) #t)))
(if a0-8
(set! s3-0 (the int (+ 5.0 (print-game-text a0-8 s5-0 #t 128 20))))
(set! s3-0 25)
)
)
(set! s2-0 #f)
)
(cond
((>= (the-as uint gp-0) (the-as uint 3249))
#t
)
(else
(set! (-> s5-0 origin y) (the float s4-0))
(while (< (-> s5-0 origin y) (the float (-> *video-parms* screen-sy)))
(let ((a0-11 (lookup-text! *common-text* (the-as game-text-id gp-0) #t)))
(if a0-11
(set! v1-13 (the int (+ 5.0 (print-game-text a0-11 s5-0 #f 128 20))))
(set! v1-13 25)
(gp-0 2815)
(s3-0 0)
(s2-0 #t)
(s5-0
(new 'stack 'font-context *font-default-matrix* 31 0 0.0 (font-color default) (font-flags shadow kerning))
)
)
(let ((v1-2 s5-0))
(set! (-> v1-2 width) (the float 450))
)
(let ((v1-3 s5-0))
(set! (-> v1-3 height) (the float 10))
)
(let ((v1-4 s5-0))
(set! (-> v1-4 scale) 1.0)
)
(set! (-> s5-0 flags) (font-flags shadow kerning middle large))
(while (or s2-0 (and (< s4-0 (- s3-0)) (< (the-as uint gp-0) (the-as uint 3249))))
(+! s4-0 s3-0)
(+! gp-0 1)
(let ((a0-8 (lookup-text! *common-text* (the-as game-text-id gp-0) #t)))
(if a0-8
(set! s3-0 (the int (+ 5.0 (print-game-text a0-8 s5-0 #t 128 20))))
(set! s3-0 25)
)
)
(set! s2-0 #f)
)
(cond
((>= (the-as uint gp-0) (the-as uint 3249))
#t
)
(else
(set! (-> s5-0 origin y) (the float s4-0))
(while (< (-> s5-0 origin y) (the float (-> *video-parms* screen-sy)))
(let ((a0-11 (lookup-text! *common-text* (the-as game-text-id gp-0) #t)))
(if a0-11
(set! v1-13 (the int (+ 5.0 (print-game-text a0-11 s5-0 #f 128 20))))
(set! v1-13 25)
)
)
(+! (-> s5-0 origin y) (the float v1-13))
(+! gp-0 1)
)
#f
)
)
(set! (-> s5-0 origin y) (+ (-> s5-0 origin y) (the float v1-13)))
(+! gp-0 1)
)
#f
)
)
)
)
@@ -151,10 +151,7 @@
)
;; maps options to a progress screen
(#if (not PC_PORT)
(define *options-remap* (new 'static 'boxed-array :type (array game-option) :length 0 :allocated-length 35))
(define *options-remap* (new 'static 'boxed-array :type (array game-option) :length 0 :allocated-length 50))
)
(define *options-remap* (new 'static 'boxed-array :type (array game-option) :length 0 :allocated-length (#if (not PC_PORT) 35 50)))
;; TODO probably an enum.
;; maps "levels" to the appropriate offset in *level-task-data*
+5 -34
View File
@@ -8,12 +8,12 @@
(define-extern blocking-plane-destroy (function none))
(define-extern blocking-plane-spawn (function curve-control none))
;; failed to figure out what this is:
;; DECOMP BEGINS
(if (not (nmember "racerp" *kernel-packages*))
(set! *kernel-packages* (cons "racerp" *kernel-packages*))
)
;; definition of type racer
(deftype racer (process-drawable)
((parent-override (pointer target) :offset 12)
(root-override collide-shape-moving :offset 112)
@@ -38,24 +38,7 @@
)
)
;; definition for method 3 of type racer
(defmethod inspect racer ((obj racer))
(let ((t9-0 (method-of-type process-drawable inspect)))
(t9-0 obj)
)
(format #t "~T~Textra-trans: ~`vector`P~%" (-> obj extra-trans))
(format #t "~T~Tcondition: ~D~%" (-> obj condition))
(format #t "~T~Tcell: ~D~%" (-> obj cell))
(format #t "~T~Tpath-data[2] @ #x~X~%" (-> obj path-data))
(format #t "~T~Tpath-target: ~A~%" (-> obj path-target))
(format #t "~T~Tpath-racer: ~A~%" (-> obj path-racer))
(format #t "~T~Tauto-get-off: ~A~%" (-> obj auto-get-off))
(format #t "~T~Tshadow-backup: ~A~%" (-> obj shadow-backup))
obj
)
;; definition for method 7 of type racer
;; INFO: Return type mismatch process-drawable vs racer.
(defmethod relocate racer ((obj racer) (arg0 int))
(countdown (v1-0 2)
(if (-> obj path-data v1-0)
@@ -65,7 +48,6 @@
(the-as racer ((method-of-type process-drawable relocate) obj arg0))
)
;; failed to figure out what this is:
(defskelgroup *racer-sg* racer
0
3
@@ -76,7 +58,6 @@
:sort 1
)
;; failed to figure out what this is:
(defskelgroup *racer-explode-sg* racer
22
24
@@ -85,9 +66,7 @@
:longest-edge (meters 0)
)
;; definition for symbol *racer-shadow-control*, type shadow-control
(define
*racer-shadow-control*
(define *racer-shadow-control*
(new 'static 'shadow-control :settings (new 'static 'shadow-settings
:center
(new 'static 'vector :w (the-as float #xa))
@@ -99,8 +78,6 @@
)
)
;; definition for function racer-effect
;; INFO: Return type mismatch int vs none.
(defbehavior racer-effect racer ()
(when (!= (-> self condition) 4)
(spawn (-> self part) (-> self root-override trans))
@@ -110,7 +87,6 @@
(none)
)
;; failed to figure out what this is:
(defstate wait-for-start (racer)
:virtual #t
:event
@@ -243,7 +219,6 @@
)
)
;; failed to figure out what this is:
(defstate idle (racer)
:virtual #t
:event
@@ -281,7 +256,7 @@
(hide-hud)
(level-hint-surpress!)
(kill-current-level-hint '() '(sidekick voicebox) 'exit)
(when (and (hud-hidden?) (can-grab-display? (the-as process-taskable self)))
(when (and (hud-hidden?) (can-grab-display? self))
(let ((gp-0
(new 'stack 'font-context *font-default-matrix* 32 160 0.0 (font-color default) (font-flags shadow kerning))
)
@@ -310,7 +285,6 @@
(the-as (function none :behavior racer) ja-post)
)
;; failed to figure out what this is:
(defstate pickup (racer)
:virtual #t
:event
@@ -384,7 +358,7 @@
(suspend)
)
(let ((s5-0 (-> *display* base-frame-counter)))
(until (>= (- (-> *display* base-frame-counter) s5-0) 300)
(until (>= (- (-> *display* base-frame-counter) s5-0) (seconds 1))
(racer-effect)
(suspend)
)
@@ -394,7 +368,6 @@
)
)
;; failed to figure out what this is:
(defstate wait-for-return (racer)
:virtual #t
:event
@@ -446,8 +419,6 @@
)
)
;; definition for method 11 of type racer
;; INFO: Return type mismatch object vs none.
(defmethod init-from-entity! racer ((obj racer) (arg0 entity-actor))
(let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player))))
(set! (-> s4-0 dynam) (copy *standard-dynamics* 'process))