mirror of
https://github.com/open-goal/jak-project
synced 2026-06-20 08:13:33 -04:00
g/j1: store volume, vibration, and play-hints in pc-settings
This commit is contained in:
@@ -594,14 +594,16 @@
|
||||
;; loop over all tags
|
||||
(while (< (the-as int save-data) (the-as int (+ (+ (-> save length) 76) (the-as int save))))
|
||||
(let ((a0-1 (-> save-data elt-type)))
|
||||
;; og:preserve-this Moved these settings to pc-settings
|
||||
(cond
|
||||
((= a0-1 (game-save-elt sfx-volume)) (set! (-> *setting-control* default sfx-volume) (-> save-data user-float0)))
|
||||
((= a0-1 (game-save-elt music-volume)) (set! (-> *setting-control* default music-volume) (-> save-data user-float0)))
|
||||
((= a0-1 (game-save-elt dialog-volume)) (set! (-> *setting-control* default dialog-volume) (-> save-data user-float0)))
|
||||
;; ((= a0-1 (game-save-elt sfx-volume)) (set! (-> *setting-control* default sfx-volume) (-> save-data user-float0)))
|
||||
;; ((= a0-1 (game-save-elt music-volume)) (set! (-> *setting-control* default music-volume) (-> save-data user-float0)))
|
||||
;; ((= a0-1 (game-save-elt dialog-volume)) (set! (-> *setting-control* default dialog-volume) (-> save-data user-float0)))
|
||||
((= a0-1 (game-save-elt language))
|
||||
(set! (-> *setting-control* default language) (the-as language-enum (-> save-data user-uint64))))
|
||||
((= a0-1 (game-save-elt vibration)) (set! (-> *setting-control* default vibration) (= (-> save-data user-uint64) 1)))
|
||||
((= a0-1 (game-save-elt play-hints)) (set! (-> *setting-control* default play-hints) (= (-> save-data user-uint64) 1)))))
|
||||
;; ((= a0-1 (game-save-elt vibration)) (set! (-> *setting-control* default vibration) (= (-> save-data user-uint64) 1)))
|
||||
;; ((= a0-1 (game-save-elt play-hints)) (set! (-> *setting-control* default play-hints) (= (-> save-data user-uint64) 1)))
|
||||
(else (format 0 "PC PORT: Skipping setting from game save, its stored in the pc-settings now"))))
|
||||
(set! save-data
|
||||
(the-as game-save-tag
|
||||
(&+ (the-as pointer save-data) (logand -16 (+ (* (the-as int (-> save-data elt-size)) (-> save-data elt-count)) 31)))))))
|
||||
|
||||
@@ -548,6 +548,11 @@
|
||||
(("controller-led-brightness") (set! (-> obj controller-led-brightness) (file-stream-read-float file)))
|
||||
(("controller-led-min-brightness") (set! (-> obj controller-led-min-brightness) (file-stream-read-float file)))
|
||||
(("controller-led-max-brightness") (set! (-> obj controller-led-max-brightness) (file-stream-read-float file)))
|
||||
(("memcard-volume-sfx") (set! (-> obj memcard-volume-sfx) (file-stream-read-float file)))
|
||||
(("memcard-volume-music") (set! (-> obj memcard-volume-music) (file-stream-read-float file)))
|
||||
(("memcard-volume-dialog") (set! (-> obj memcard-volume-dialog) (file-stream-read-float file)))
|
||||
(("memcard-vibration") (set! (-> obj memcard-vibration) (file-stream-read-symbol file)))
|
||||
(("memcard-play-hints") (set! (-> obj memcard-play-hints) (file-stream-read-symbol file)))
|
||||
;; debug
|
||||
(("debug-font-scale") (set! (-> obj debug-font-scale) (file-stream-read-float file)))
|
||||
(("debug-font-scale-auto?") (set! (-> obj debug-font-scale-auto?) (file-stream-read-symbol file)))
|
||||
@@ -622,6 +627,11 @@
|
||||
(format file " (game-language ~D)~%" (get-game-language obj))
|
||||
(format file " (subtitle-speaker ~A)~%" (-> obj subtitle-speaker?))
|
||||
(format file " (territory ~D)~%" (-> obj territory))
|
||||
(format file " (memcard-volume-sfx ~f)~%" (-> obj memcard-volume-sfx))
|
||||
(format file " (memcard-volume-music ~f)~%" (-> obj memcard-volume-music))
|
||||
(format file " (memcard-volume-dialog ~f)~%" (-> obj memcard-volume-dialog))
|
||||
(format file " (memcard-vibration ~A)~%" (-> obj memcard-vibration))
|
||||
(format file " (memcard-play-hints ~A)~%" (-> obj memcard-play-hints))
|
||||
0)
|
||||
|
||||
(defmethod write-to-file ((obj pc-settings) (filename string))
|
||||
@@ -657,6 +667,11 @@
|
||||
;; any post-operations that need to be done after loading
|
||||
(set! (-> obj keyboard-enabled?) (pc-get-keyboard-enabled?))
|
||||
(update-mouse-controls! obj)
|
||||
(set! (-> *setting-control* default sfx-volume) (-> obj memcard-volume-sfx))
|
||||
(set! (-> *setting-control* default music-volume) (-> obj memcard-volume-music))
|
||||
(set! (-> *setting-control* default dialog-volume) (-> obj memcard-volume-dialog))
|
||||
(set! (-> *setting-control* default vibration) (-> obj memcard-vibration))
|
||||
(set! (-> *setting-control* default play-hints) (-> obj memcard-play-hints))
|
||||
obj)
|
||||
|
||||
(defmethod new pc-settings ((allocation symbol) (type-to-make type))
|
||||
|
||||
@@ -193,7 +193,13 @@
|
||||
(discord-rpc? symbol) ;; enable discord rich presence integration
|
||||
(speedrunner-mode? symbol) ;; enable speedrunner mode
|
||||
(flava-hack int64)
|
||||
;; TODO - save/restore original settings (language/sound/etc)
|
||||
;; settings originally stored in the game save
|
||||
;; now stored in pc-settings
|
||||
(memcard-volume-sfx float)
|
||||
(memcard-volume-music float)
|
||||
(memcard-volume-dialog float)
|
||||
(memcard-vibration symbol)
|
||||
(memcard-play-hints symbol)
|
||||
)
|
||||
(:methods
|
||||
(new (symbol type) _type_)
|
||||
@@ -391,6 +397,12 @@
|
||||
(set! (-> obj subtitle-speaker?) 'auto)
|
||||
(reset-camera obj call-handlers)
|
||||
(set! (-> obj territory) -1) ;; auto
|
||||
;; original settings, minus 25 to be a bit more conservative
|
||||
(set! (-> obj memcard-volume-sfx) 50.0)
|
||||
(set! (-> obj memcard-volume-music) 40.0)
|
||||
(set! (-> obj memcard-volume-dialog) 75.0)
|
||||
(set! (-> obj memcard-vibration) #t)
|
||||
(set! (-> obj memcard-play-hints) #t)
|
||||
0)
|
||||
|
||||
(defmethod reset-camera ((obj pc-settings) (call-handlers symbol))
|
||||
|
||||
@@ -1473,19 +1473,19 @@
|
||||
(set! (-> *progress-state* video-mode-choice) (get-video-mode))
|
||||
(set! (-> *progress-state* yes-no-choice) #f)
|
||||
;; set variable pointers
|
||||
(set! (-> *game-options* 1 value-to-modify) (&-> *setting-control* default play-hints))
|
||||
(set! (-> *game-options* 1 value-to-modify) (&-> *pc-settings* memcard-play-hints))
|
||||
(set! (-> *game-options* 2 value-to-modify) (&-> *setting-control* default language))
|
||||
(set! (-> *game-options-japan* 0 value-to-modify) (&-> *setting-control* default vibration))
|
||||
(set! (-> *game-options-japan* 1 value-to-modify) (&-> *setting-control* default play-hints))
|
||||
(set! (-> *game-options-demo* 0 value-to-modify) (&-> *setting-control* default vibration))
|
||||
(set! (-> *game-options-demo* 1 value-to-modify) (&-> *setting-control* default play-hints))
|
||||
(set! (-> *game-options-japan* 0 value-to-modify) (&-> *pc-settings* memcard-vibration))
|
||||
(set! (-> *game-options-japan* 1 value-to-modify) (&-> *pc-settings* memcard-play-hints))
|
||||
(set! (-> *game-options-demo* 0 value-to-modify) (&-> *pc-settings* memcard-vibration))
|
||||
(set! (-> *game-options-demo* 1 value-to-modify) (&-> *pc-settings* memcard-play-hints))
|
||||
(set! (-> *graphic-options* 1 value-to-modify) (&-> *progress-state* aspect-ratio-choice))
|
||||
(set! (-> *sound-options* 0 value-to-modify) (&-> *setting-control* default sfx-volume))
|
||||
(set! (-> *sound-options* 1 value-to-modify) (&-> *setting-control* default music-volume))
|
||||
(set! (-> *sound-options* 2 value-to-modify) (&-> *setting-control* default dialog-volume))
|
||||
(set! (-> *yes-no-options* 0 value-to-modify) (&-> *progress-state* yes-no-choice))
|
||||
;; our options!
|
||||
(set! (-> *game-options-pc* 1 value-to-modify) (&-> *setting-control* default play-hints))
|
||||
(set! (-> *game-options-pc* 1 value-to-modify) (&-> *pc-settings* memcard-play-hints))
|
||||
(set! (-> *game-options-pc* 2 value-to-modify) (&-> *pc-settings* subtitles?))
|
||||
(set! (-> *game-options-pc* 3 value-to-modify) (&-> *pc-settings* hinttitles?))
|
||||
(set! (-> *game-options-pc* 4 value-to-modify) (&-> *setting-control* default language))
|
||||
@@ -1506,7 +1506,7 @@
|
||||
(set! (-> *camera-options* 2 value-to-modify) (&-> *pc-settings* third-camera-h-inverted?))
|
||||
(set! (-> *camera-options* 3 value-to-modify) (&-> *pc-settings* third-camera-v-inverted?))
|
||||
;; input options
|
||||
(set! (-> *controller-options* 1 value-to-modify) (&-> *setting-control* default vibration))
|
||||
(set! (-> *controller-options* 1 value-to-modify) (&-> *pc-settings* memcard-vibration))
|
||||
(set! (-> *controller-options* 2 value-to-modify) (&-> *pc-settings* stick-deadzone))
|
||||
(set! (-> *controller-options* 3 value-to-modify) (&-> *pc-settings* ignore-controller-win-unfocused?))
|
||||
(set! (-> *controller-options* 4 value-to-modify) (&-> *pc-settings* controller-led-hp?))
|
||||
@@ -1524,9 +1524,9 @@
|
||||
(set! (-> *gfx-ps2-options* 2 value-to-modify) (&-> *pc-settings* ps2-parts?))
|
||||
(set! (-> *gfx-ps2-options* 3 value-to-modify) (&-> *pc-settings* force-envmap?))
|
||||
(set! (-> *gfx-ps2-options* 4 value-to-modify) (&-> *pc-settings* ps2-actor-vis?))
|
||||
(set! (-> *sound-options-pc* 0 value-to-modify) (&-> *setting-control* default sfx-volume))
|
||||
(set! (-> *sound-options-pc* 1 value-to-modify) (&-> *setting-control* default music-volume))
|
||||
(set! (-> *sound-options-pc* 2 value-to-modify) (&-> *setting-control* default dialog-volume))
|
||||
(set! (-> *sound-options-pc* 0 value-to-modify) (&-> *pc-settings* memcard-volume-sfx))
|
||||
(set! (-> *sound-options-pc* 1 value-to-modify) (&-> *pc-settings* memcard-volume-music))
|
||||
(set! (-> *sound-options-pc* 2 value-to-modify) (&-> *pc-settings* memcard-volume-dialog))
|
||||
(dotimes (i (1- (-> *cheats* length)))
|
||||
(set! (-> *cheats* i value-to-modify) (&-> *progress-carousell* symbol-backup)))
|
||||
;(set! (-> *sound-options-pc* 3 value-to-modify) (&-> *pc-settings* music-fadein?))
|
||||
|
||||
Reference in New Issue
Block a user