Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3 sound banks #25

Merged
merged 2 commits into from
Sep 11, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion data/goal_src/jak1/engine/game/main.gc
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@
(format *stdcon* "level ~D ~12A ~A~%" i (-> *level* level i name) (-> *level* level i display?))
)
(format *stdcon* "music ~A (f: ~D/~S)~%" (-> *setting-control* current music) (-> *setting-control* current sound-flava) (enum->string music-flava (-> *setting-control* default sound-flava)))
(format *stdcon* "sound ~A ~A~%" *sound-bank-1* *sound-bank-2*)
(format *stdcon* "sound ~A ~A ~A~%" *sound-bank-1* *sound-bank-2* *sound-bank-3*)
(let ((pos (target-pos 0)))
(format *stdcon* "target ~m ~m ~m~%" (-> pos x) (-> pos y) (-> pos z))
)
Expand Down
1 change: 1 addition & 0 deletions data/goal_src/jak1/engine/game/settings.gc
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@
(zero? (rpc-busy? 1))
*sound-bank-1*
*sound-bank-2*
*sound-bank-3*
)
)
(cond
Expand Down
40 changes: 20 additions & 20 deletions data/goal_src/jak1/engine/level/level-info.gc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
:visname 'training-vis
:nickname 'tra
:packages '(training)
:sound-banks '(training)
:sound-banks '(training snow)
:music-bank 'village1
:ambient-sounds '()
:mood '*training-mood*
Expand Down Expand Up @@ -117,7 +117,7 @@
:visname 'village1-vis
:nickname 'vi1
:packages '(village1)
:sound-banks '(village1)
:sound-banks '(village1 snow)
:music-bank 'village1
:ambient-sounds '()
:mood '*village1-mood*
Expand Down Expand Up @@ -232,7 +232,7 @@
:visname 'beach-vis
:nickname 'bea
:packages '(beach)
:sound-banks '(beach)
:sound-banks '(beach snow)
:music-bank 'beach
:ambient-sounds '()
:mood '*beach-mood*
Expand Down Expand Up @@ -275,7 +275,7 @@
:visname 'jungle-vis
:nickname 'jun
:packages '(jungle)
:sound-banks '(jungle)
:sound-banks '(jungle snow)
:music-bank 'jungle
:ambient-sounds '()
:mood '*jungle-mood*
Expand Down Expand Up @@ -318,7 +318,7 @@
:visname 'jungleb-vis
:nickname 'jub
:packages '(jungleb)
:sound-banks '(jungleb)
:sound-banks '(jungleb snow)
:music-bank 'jungleb
:ambient-sounds '()
:mood '*jungleb-mood*
Expand Down Expand Up @@ -359,7 +359,7 @@
:visname 'misty-vis
:nickname 'mis
:packages '(misty)
:sound-banks '(misty)
:sound-banks '(misty snow)
:music-bank 'misty
:ambient-sounds '()
:mood '*misty-mood*
Expand Down Expand Up @@ -518,7 +518,7 @@
:visname 'firecanyon-vis
:nickname 'fic
:packages '(firecanyon)
:sound-banks '(firecanyon)
:sound-banks '(firecanyon snow)
:music-bank 'firecanyon
:ambient-sounds '()
:mood '*firecanyon-mood*
Expand Down Expand Up @@ -574,7 +574,7 @@
:visname 'village2-vis
:nickname 'vi2
:packages '(village2)
:sound-banks '(village2)
:sound-banks '(village2 snow)
:music-bank 'village2
:ambient-sounds '()
:mood '*village2-mood*
Expand Down Expand Up @@ -645,7 +645,7 @@
:visname 'sunken-vis
:nickname 'sun
:packages '(sunken)
:sound-banks '(sunken)
:sound-banks '(sunken snow)
:music-bank 'sunken
:ambient-sounds '()
:mood '*sunken-mood*
Expand Down Expand Up @@ -729,7 +729,7 @@
:visname 'sunkenb-vis
:nickname 'sub
:packages '()
:sound-banks '(sunken)
:sound-banks '(sunken snow)
:music-bank 'sunken
:ambient-sounds '()
:mood '*sunkenb-mood*
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didn't bother adding snow soundbank to boggy

Expand Down Expand Up @@ -953,7 +953,7 @@
:visname 'rolling-vis
:nickname 'rol
:packages '(rolling)
:sound-banks '(rolling)
:sound-banks '(rolling snow)
:music-bank 'rolling
:ambient-sounds '()
:mood '*rolling-mood*
Expand Down Expand Up @@ -995,7 +995,7 @@
:visname 'ogre-vis
:nickname 'ogr
:packages '(ogre)
:sound-banks '(ogre)
:sound-banks '(ogre snow)
:music-bank 'ogre
:ambient-sounds '()
:mood '*ogre-mood*
Expand Down Expand Up @@ -1065,7 +1065,7 @@
:visname 'village3-vis
:nickname 'vi3
:packages '(village3)
:sound-banks '(village3)
:sound-banks '(village3 snow)
:music-bank 'village3
:ambient-sounds '()
:mood '*village3-mood*
Expand Down Expand Up @@ -1291,7 +1291,7 @@
:visname 'maincave-vis
:nickname 'mai
:packages '(maincave)
:sound-banks '(maincave)
:sound-banks '(maincave snow)
:music-bank 'maincave
:ambient-sounds '()
:mood '*maincave-mood*
Expand Down Expand Up @@ -1361,7 +1361,7 @@
:visname 'darkcave-vis
:nickname 'dar
:packages '(darkcave)
:sound-banks '(darkcave)
:sound-banks '(darkcave snow)
:music-bank 'maincave
:ambient-sounds '()
:mood '*darkcave-mood*
Expand Down Expand Up @@ -1403,7 +1403,7 @@
:visname 'robocave-vis
:nickname 'rob
:packages '(robocave)
:sound-banks '(robocave)
:sound-banks '(robocave snow)
:music-bank 'maincave
:ambient-sounds '()
:mood '*robocave-mood*
Expand Down Expand Up @@ -1459,7 +1459,7 @@
:visname 'lavatube-vis
:nickname 'lav
:packages '(lavatube)
:sound-banks '(lavatube)
:sound-banks '(lavatube snow)
:music-bank 'lavatube
:ambient-sounds '()
:mood '*lavatube-mood*
Expand Down Expand Up @@ -1543,7 +1543,7 @@
:visname 'citadel-vis
:nickname 'cit
:packages '(citadel)
:sound-banks '(citadel)
:sound-banks '(citadel snow)
:music-bank 'citadel
:ambient-sounds '()
:mood '*citadel-mood*
Expand Down Expand Up @@ -1712,7 +1712,7 @@
:visname 'finalboss-vis
:nickname 'fin
:packages '(finalboss)
:sound-banks '(finalboss)
:sound-banks '(finalboss snow)
:music-bank 'finalboss
:ambient-sounds '()
:mood '*finalboss-mood*
Expand Down Expand Up @@ -1795,7 +1795,7 @@
:visname 'demo-vis
:nickname 'dem
:packages '()
:sound-banks '(village1)
:sound-banks '(village1 snow)
:music-bank 'village1
:ambient-sounds '()
:mood '*default-mood*
Expand Down
85 changes: 57 additions & 28 deletions data/goal_src/jak1/engine/level/level.gc
Original file line number Diff line number Diff line change
Expand Up @@ -1572,8 +1572,9 @@
(if (nonzero? (rpc-busy? RPC-SOUND-LOADER))
(return 0)
)
(let ((gp-0 #f)
(s5-0 #f)
(let ((sb1 #f)
(sb2 #f)
(sb3 #f)
)
(dotimes (s4-0 (-> *level* length))
(let ((v1-5 (-> *level* level s4-0)))
Expand All @@ -1583,20 +1584,24 @@
)
(while (not (null? s3-0))
(cond
((or (= gp-0 t0-0) (= s5-0 t0-0) (-> *setting-control* current movie))
((or (= sb1 t0-0) (= sb2 t0-0) (= sb3 t0-0) (-> *setting-control* current movie))
)
((not gp-0)
(set! gp-0 t0-0)
((not sb1)
(set! sb1 t0-0)
)
((not s5-0)
(set! s5-0 t0-0)
((not sb2)
(set! sb2 t0-0)
)
((not sb3)
(set! sb2 t0-0)
)
(else
(format
0
"ERROR: Soundbanks ~A, ~A and ~A all required~%"
gp-0
s5-0
"ERROR: Soundbanks ~A, ~A, ~A and ~A all required, only 3 supported~%"
sb1
sb2
sb3
t0-0
)
)
Expand All @@ -1608,57 +1613,81 @@
)
)
)
(when (and gp-0 (!= gp-0 *sound-bank-1*) (!= gp-0 *sound-bank-2*))
(when (and sb1 (!= sb1 *sound-bank-1*) (!= sb1 *sound-bank-2*) (!= sb1 *sound-bank-3*))
(when (not *sound-bank-1*)
(format 0 "Load soundbank ~A~%" gp-0)
(sound-bank-load (string->sound-name (symbol->string gp-0)))
(set! *sound-bank-1* gp-0)
(format 0 "Load soundbank ~A~%" sb1)
(sound-bank-load (string->sound-name (symbol->string sb1)))
(set! *sound-bank-1* sb1)
(return 0)
)
(when (not *sound-bank-2*)
(format 0 "Load soundbank ~A~%" gp-0)
(sound-bank-load (string->sound-name (symbol->string gp-0)))
(set! *sound-bank-2* gp-0)
(format 0 "Load soundbank ~A~%" sb1)
(sound-bank-load (string->sound-name (symbol->string sb1)))
(set! *sound-bank-2* sb1)
(return 0)
)
(when (not *sound-bank-3*)
(format 0 "Load soundbank ~A~%" sb1)
(sound-bank-load (string->sound-name (symbol->string sb1)))
(set! *sound-bank-3* sb1)
(return 0)
)
(when (!= *sound-bank-1* s5-0)
(when (!= *sound-bank-1* sb2)
(format 0 "Unload soundbank ~A~%" *sound-bank-1*)
(sound-bank-unload (string->sound-name (symbol->string *sound-bank-1*)))
(set! *sound-bank-1* #f)
(return 0)
)
(when (!= *sound-bank-2* s5-0)
(when (!= *sound-bank-2* sb2)
(format 0 "Unload soundbank ~A~%" *sound-bank-2*)
(sound-bank-unload (string->sound-name (symbol->string *sound-bank-2*)))
(set! *sound-bank-2* #f)
(return 0)
)
(when (!= *sound-bank-3* sb2)
(format 0 "Unload soundbank ~A~%" *sound-bank-3*)
(sound-bank-unload (string->sound-name (symbol->string *sound-bank-3*)))
(set! *sound-bank-3* #f)
(return 0)
)
)
(when (and s5-0 (!= s5-0 *sound-bank-1*) (!= s5-0 *sound-bank-2*))
(when (and sb2 (!= sb2 *sound-bank-1*) (!= sb2 *sound-bank-2*) (!= sb2 *sound-bank-3*))
(when (not *sound-bank-1*)
(format 0 "Load soundbank ~A~%" s5-0)
(sound-bank-load (string->sound-name (symbol->string s5-0)))
(set! *sound-bank-1* s5-0)
(format 0 "Load soundbank ~A~%" sb2)
(sound-bank-load (string->sound-name (symbol->string sb2)))
(set! *sound-bank-1* sb2)
(return 0)
)
(when (not *sound-bank-2*)
(format 0 "Load soundbank ~A~%" s5-0)
(sound-bank-load (string->sound-name (symbol->string s5-0)))
(set! *sound-bank-2* s5-0)
(format 0 "Load soundbank ~A~%" sb2)
(sound-bank-load (string->sound-name (symbol->string sb2)))
(set! *sound-bank-2* sb2)
(return 0)
)
(when (!= *sound-bank-1* gp-0)
(when (not *sound-bank-3*)
(format 0 "Load soundbank ~A~%" sb2)
(sound-bank-load (string->sound-name (symbol->string sb2)))
(set! *sound-bank-3* sb2)
(return 0)
)
(when (!= *sound-bank-1* sb1)
(format 0 "Unload soundbank ~A~%" *sound-bank-1*)
(sound-bank-unload (string->sound-name (symbol->string *sound-bank-1*)))
(set! *sound-bank-1* #f)
(return 0)
)
(when (!= *sound-bank-2* gp-0)
(when (!= *sound-bank-2* sb1)
(format 0 "Unload soundbank ~A~%" *sound-bank-2*)
(sound-bank-unload (string->sound-name (symbol->string *sound-bank-2*)))
(set! *sound-bank-2* #f)
(return 0)
)
(when (!= *sound-bank-3* sb1)
(format 0 "Unload soundbank ~A~%" *sound-bank-3*)
(sound-bank-unload (string->sound-name (symbol->string *sound-bank-2*)))
(set! *sound-bank-3* #f)
(return 0)
)
)
)
0
Expand Down
3 changes: 2 additions & 1 deletion data/goal_src/jak1/engine/sound/gsound-h.gc
Original file line number Diff line number Diff line change
Expand Up @@ -535,9 +535,10 @@
)

;; currently loaded sound effect banks.
;; there is an always-loaded common bank and two level-specific banks.
;; there is an always-loaded common bank and three level-specific banks.
(define *sound-bank-1* #f)
(define *sound-bank-2* #f)
(define *sound-bank-3* #f)

(defun-extern string->sound-name string sound-name)
(defun-extern sound-set-ear-trans vector vector float int)
Expand Down
6 changes: 4 additions & 2 deletions data/goal_src/jak1/engine/sound/gsound.gc
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,13 @@
(sound-bank-load (static-sound-name "common"))
)
)
(sound-bank-load (static-sound-name "empty0"))
(sound-bank-load (static-sound-name "empty1"))
(sound-bank-load (static-sound-name "empty2"))

(define *sound-bank-1* 'empty1)
(define *sound-bank-2* 'empty2)
(define *sound-bank-1* 'empty0)
(define *sound-bank-2* 'empty1)
(define *sound-bank-3* 'empty2)

(defun sound-reload-info ()
(let ((cmd (the sound-rpc-reload-info (add-element *sound-loader-rpc*))))
Expand Down