mirror of
https://github.com/open-goal/jak-project
synced 2026-06-13 14:07:02 -04:00
Use "Inverted" terminology for cam options, add "Restore Original" option (#1361)
* use normal/inverted and add option to restore original jak 1 defaults * fix bad merge * PR feedback
This commit is contained in:
@@ -1307,11 +1307,12 @@
|
||||
;; extra IDs for pc port
|
||||
(camera-options #x1000)
|
||||
(normal #x1001)
|
||||
(flipped #x1002)
|
||||
(inverted #x1002)
|
||||
(camera-controls-first-horz #x1003)
|
||||
(camera-controls-first-vert #x1004)
|
||||
(camera-controls-third-horz #x1005)
|
||||
(camera-controls-third-vert #x1006)
|
||||
(camera-controls-original #x1007)
|
||||
(misc-options #x100f)
|
||||
(accessibility-options #x1010)
|
||||
(money-starburst #x1011)
|
||||
@@ -15536,7 +15537,7 @@
|
||||
(button 8)
|
||||
|
||||
;; extra types for pc port
|
||||
(normal-flipped)
|
||||
(normal-inverted)
|
||||
(display-mode)
|
||||
(msaa)
|
||||
(frame-rate)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
"CAMERA OPTIONS")
|
||||
(#x1001 "NORMAL"
|
||||
"NORMAL")
|
||||
(#x1002 "FLIPPED"
|
||||
"FLIPPED")
|
||||
(#x1002 "INVERTED"
|
||||
"INVERTED")
|
||||
(#x1003 "1ST-PERSON HORIZONTAL CAMERA"
|
||||
"1ST-PERSON HORIZONTAL CAMERA")
|
||||
(#x1004 "1ST-PERSON VERTICAL CAMERA"
|
||||
@@ -18,6 +18,8 @@
|
||||
"3RD-PERSON HORIZONTAL CAMERA")
|
||||
(#x1006 "3RD-PERSON VERTICAL CAMERA"
|
||||
"3RD-PERSON VERTICAL CAMERA")
|
||||
(#x1007 "RESTORE ORIGINAL GAME CONTROLS"
|
||||
"RESTORE ORIGINAL GAME CONTROLS")
|
||||
|
||||
(#x100f "MISCELLANEOUS"
|
||||
"MISCELLANEOUS")
|
||||
|
||||
@@ -2330,9 +2330,9 @@
|
||||
)
|
||||
;; changed for pc port, only used for Third-Person Vertical camera
|
||||
(#if PC_PORT
|
||||
(* (if (-> *pc-settings* third-camera-vflip?) -1.0 1.0) f0-0)
|
||||
f0-0
|
||||
)
|
||||
(* (if (-> *pc-settings* third-camera-v-inverted?) 1.0 -1.0) f0-0)
|
||||
f0-0
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
+31
-19
@@ -200,37 +200,49 @@
|
||||
)
|
||||
)
|
||||
|
||||
(defmacro analog-input-vertical-first (in offset center-val max-val out-range)
|
||||
"Same as analog-input but respects First-Person Vertical camera control setting."
|
||||
`(#if PC_PORT
|
||||
(* (if (-> *pc-settings* first-camera-vflip?) -1.0 1.0) (analog-input ,in ,offset ,center-val ,max-val ,out-range))
|
||||
(analog-input ,in ,offset ,center-val ,max-val ,out-range)
|
||||
)
|
||||
)
|
||||
|
||||
(defmacro analog-input-horizontal-first (in offset center-val max-val out-range)
|
||||
"Same as analog-input but respects First-Person Horizontal camera control setting."
|
||||
`(#if PC_PORT
|
||||
(* (if (-> *pc-settings* first-camera-hflip?) -1.0 1.0) (analog-input ,in ,offset ,center-val ,max-val ,out-range))
|
||||
(analog-input ,in ,offset ,center-val ,max-val ,out-range)
|
||||
)
|
||||
(*
|
||||
(if (-> *pc-settings* first-camera-h-inverted?) -1.0 1.0) ;; first-person horizontal is NOT inverted in original game
|
||||
(analog-input ,in ,offset ,center-val ,max-val ,out-range)
|
||||
)
|
||||
(analog-input ,in ,offset ,center-val ,max-val ,out-range)
|
||||
)
|
||||
)
|
||||
|
||||
(defmacro analog-input-vertical-third (in offset center-val max-val out-range)
|
||||
"Same as analog-input but respects Third-Person Vertical camera control setting."
|
||||
(defmacro analog-input-vertical-first (in offset center-val max-val out-range)
|
||||
"Same as analog-input but respects First-Person Vertical camera control setting."
|
||||
`(#if PC_PORT
|
||||
(* (if (-> *pc-settings* third-camera-vflip?) -1.0 1.0) (analog-input ,in ,offset ,center-val ,max-val ,out-range))
|
||||
(analog-input ,in ,offset ,center-val ,max-val ,out-range)
|
||||
)
|
||||
(*
|
||||
(if (-> *pc-settings* first-camera-v-inverted?) 1.0 -1.0) ;; first-person vertical is already inverted in original game
|
||||
(analog-input ,in ,offset ,center-val ,max-val ,out-range)
|
||||
)
|
||||
(analog-input ,in ,offset ,center-val ,max-val ,out-range)
|
||||
)
|
||||
)
|
||||
|
||||
(defmacro analog-input-horizontal-third (in offset center-val max-val out-range)
|
||||
"Same as analog-input but respects Third-Person Horizontal camera control setting."
|
||||
`(#if PC_PORT
|
||||
(* (if (-> *pc-settings* third-camera-hflip?) -1.0 1.0) (analog-input ,in ,offset ,center-val ,max-val ,out-range))
|
||||
(analog-input ,in ,offset ,center-val ,max-val ,out-range)
|
||||
)
|
||||
(*
|
||||
(if (-> *pc-settings* third-camera-h-inverted?) 1.0 -1.0) ;; third-person horizontal is already inverted in original game
|
||||
(analog-input ,in ,offset ,center-val ,max-val ,out-range)
|
||||
)
|
||||
(analog-input ,in ,offset ,center-val ,max-val ,out-range)
|
||||
)
|
||||
)
|
||||
|
||||
(defmacro analog-input-vertical-third (in offset center-val max-val out-range)
|
||||
"Same as analog-input but respects Third-Person Vertical camera control setting."
|
||||
`(#if PC_PORT
|
||||
(*
|
||||
(if (-> *pc-settings* third-camera-v-inverted?) 1.0 -1.0) ;; third-person vertical is already inverted in original game
|
||||
(analog-input ,in ,offset ,center-val ,max-val ,out-range)
|
||||
)
|
||||
(analog-input ,in ,offset ,center-val ,max-val ,out-range)
|
||||
)
|
||||
)
|
||||
|
||||
(defun cpad-set-buzz! ((pad cpad-info) (buzz-idx int) (buzz-amount int) (duration time-frame))
|
||||
"Turn on vibration motor 'buzz-idx' for duration, at magnitude buzz-amount."
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
(button 8)
|
||||
|
||||
;; extra types for pc port
|
||||
(normal-flipped)
|
||||
(normal-inverted)
|
||||
(display-mode)
|
||||
(msaa)
|
||||
(frame-rate)
|
||||
|
||||
@@ -459,11 +459,12 @@
|
||||
;; extra IDs for pc port
|
||||
(camera-options #x1000)
|
||||
(normal #x1001)
|
||||
(flipped #x1002)
|
||||
(inverted #x1002)
|
||||
(camera-controls-first-horz #x1003)
|
||||
(camera-controls-first-vert #x1004)
|
||||
(camera-controls-third-horz #x1005)
|
||||
(camera-controls-third-vert #x1006)
|
||||
(camera-controls-original #x1007)
|
||||
(misc-options #x100f)
|
||||
(accessibility-options #x1010)
|
||||
(money-starburst #x1011)
|
||||
|
||||
@@ -254,10 +254,10 @@
|
||||
(hinttitles? symbol) ;; if on, non-cutscene subtitles will show up
|
||||
(subtitle-language pc-subtitle-lang) ;; language for subtitles
|
||||
(subtitle-speaker? symbol) ;; #f (force off), #t (force on), auto (on for offscreen)
|
||||
(first-camera-hflip? symbol) ;; first-person horizontal camera flipped
|
||||
(first-camera-vflip? symbol) ;; first-person vertical camera flipped
|
||||
(third-camera-hflip? symbol) ;; third-person horizontal camera flipped
|
||||
(third-camera-vflip? symbol) ;; third-person vertical camera flipped
|
||||
(first-camera-h-inverted? symbol) ;; first-person horizontal camera inverted
|
||||
(first-camera-v-inverted? symbol) ;; first-person vertical camera inverted
|
||||
(third-camera-h-inverted? symbol) ;; third-person horizontal camera inverted
|
||||
(third-camera-v-inverted? symbol) ;; third-person vertical camera inverted
|
||||
(money-starburst? symbol) ;; add a starburst to the money
|
||||
|
||||
(bingo pc-bingo-info :inline) ;; bingo integration. does nothing for now.
|
||||
@@ -284,6 +284,7 @@
|
||||
(reset-gfx (_type_) none)
|
||||
(reset-ps2 (_type_) none)
|
||||
(reset-misc (_type_) none)
|
||||
(reset-original-camera (_type_) none)
|
||||
(reset-extra (_type_) none)
|
||||
(draw (_type_ dma-buffer) none)
|
||||
(set-display-mode! (_type_ symbol) int)
|
||||
@@ -427,13 +428,19 @@
|
||||
(set! (-> obj hinttitles?) #t)
|
||||
(set! (-> obj subtitle-speaker?) 'auto)
|
||||
(set! (-> obj subtitle-language) (pc-subtitle-lang english))
|
||||
(set! (-> obj first-camera-hflip?) #f)
|
||||
(set! (-> obj first-camera-vflip?) #f)
|
||||
(set! (-> obj third-camera-hflip?) #f)
|
||||
(set! (-> obj third-camera-vflip?) #f)
|
||||
(reset-original-camera obj)
|
||||
(set! (-> obj money-starburst?) #f)
|
||||
(none))
|
||||
|
||||
(defmethod reset-original-camera pc-settings ((obj pc-settings))
|
||||
"Set the original game's camera controls"
|
||||
|
||||
(set! (-> obj first-camera-h-inverted?) #f) ;; first-person horizontal is NOT inverted in original game
|
||||
(set! (-> obj first-camera-v-inverted?) #t) ;; first-person vertical IS inverted in original game
|
||||
(set! (-> obj third-camera-h-inverted?) #t) ;; third person horizontal IS inverted in original game
|
||||
(set! (-> obj third-camera-v-inverted?) #t) ;; third-person vertical IS inverted in original game
|
||||
(none))
|
||||
|
||||
(defmethod reset-extra pc-settings ((obj pc-settings))
|
||||
"Set the default goodies settings"
|
||||
|
||||
|
||||
@@ -541,10 +541,10 @@
|
||||
(("subtitles?") (set! (-> obj subtitles?) (file-stream-read-symbol file)))
|
||||
(("hinttitles?") (set! (-> obj hinttitles?) (file-stream-read-symbol file)))
|
||||
(("discord-rpc?") (set! (-> obj discord-rpc?) (file-stream-read-symbol file)))
|
||||
(("first-camera-hflip?") (set! (-> obj first-camera-hflip?) (file-stream-read-symbol file)))
|
||||
(("first-camera-vflip?") (set! (-> obj first-camera-vflip?) (file-stream-read-symbol file)))
|
||||
(("third-camera-hflip?") (set! (-> obj third-camera-hflip?) (file-stream-read-symbol file)))
|
||||
(("third-camera-vflip?") (set! (-> obj third-camera-vflip?) (file-stream-read-symbol file)))
|
||||
(("first-camera-h-inverted?") (set! (-> obj first-camera-h-inverted?) (file-stream-read-symbol file)))
|
||||
(("first-camera-v-inverted?") (set! (-> obj first-camera-v-inverted?) (file-stream-read-symbol file)))
|
||||
(("third-camera-h-inverted?") (set! (-> obj third-camera-h-inverted?) (file-stream-read-symbol file)))
|
||||
(("third-camera-v-inverted?") (set! (-> obj third-camera-v-inverted?) (file-stream-read-symbol file)))
|
||||
(("money-starburst?") (set! (-> obj money-starburst?) (file-stream-read-symbol file)))
|
||||
(("scenes-seen")
|
||||
(dotimes (i 197)
|
||||
@@ -647,10 +647,10 @@
|
||||
(format file " (use-vis? ~A)~%" (-> obj use-vis?))
|
||||
(format file " (skip-movies? ~A)~%" (-> obj skip-movies?))
|
||||
(format file " (discord-rpc? ~A)~%" (-> obj discord-rpc?))
|
||||
(format file " (first-camera-hflip? ~A)~%" (-> obj first-camera-hflip?))
|
||||
(format file " (first-camera-vflip? ~A)~%" (-> obj first-camera-vflip?))
|
||||
(format file " (third-camera-hflip? ~A)~%" (-> obj third-camera-hflip?))
|
||||
(format file " (third-camera-vflip? ~A)~%" (-> obj third-camera-vflip?))
|
||||
(format file " (first-camera-h-inverted? ~A)~%" (-> obj first-camera-h-inverted?))
|
||||
(format file " (first-camera-v-inverted? ~A)~%" (-> obj first-camera-v-inverted?))
|
||||
(format file " (third-camera-h-inverted? ~A)~%" (-> obj third-camera-h-inverted?))
|
||||
(format file " (third-camera-v-inverted? ~A)~%" (-> obj third-camera-v-inverted?))
|
||||
(format file " (money-starburst? ~A)~%" (-> obj money-starburst?))
|
||||
(format file " (force-actors? ~A)~%" (-> obj force-actors?))
|
||||
(format file " (subtitles? ~A)~%" (-> obj subtitles?))
|
||||
|
||||
+25
-19
@@ -155,11 +155,12 @@
|
||||
)
|
||||
|
||||
(define *camera-options*
|
||||
(new 'static 'boxed-array :type game-option :length 5 :allocated-length 5
|
||||
(new 'static 'game-option :option-type (game-option-type normal-flipped) :name (game-text-id camera-controls-first-horz) :scale #t)
|
||||
(new 'static 'game-option :option-type (game-option-type normal-flipped) :name (game-text-id camera-controls-first-vert) :scale #t)
|
||||
(new 'static 'game-option :option-type (game-option-type normal-flipped) :name (game-text-id camera-controls-third-horz) :scale #t)
|
||||
(new 'static 'game-option :option-type (game-option-type normal-flipped) :name (game-text-id camera-controls-third-vert) :scale #t)
|
||||
(new 'static 'boxed-array :type game-option :length 6 :allocated-length 6
|
||||
(new 'static 'game-option :option-type (game-option-type normal-inverted) :name (game-text-id camera-controls-first-horz) :scale #t)
|
||||
(new 'static 'game-option :option-type (game-option-type normal-inverted) :name (game-text-id camera-controls-first-vert) :scale #t)
|
||||
(new 'static 'game-option :option-type (game-option-type normal-inverted) :name (game-text-id camera-controls-third-horz) :scale #t)
|
||||
(new 'static 'game-option :option-type (game-option-type normal-inverted) :name (game-text-id camera-controls-third-vert) :scale #t)
|
||||
(new 'static 'game-option :option-type (game-option-type button) :name (game-text-id camera-controls-original) :scale #t)
|
||||
(new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t)
|
||||
)
|
||||
)
|
||||
@@ -508,10 +509,10 @@
|
||||
(set! (-> *graphic-options-pc* 3 value-to-modify) (&-> *progress-state* aspect-ratio-choice))
|
||||
(set! (-> *graphic-options-pc* 5 value-to-modify) (&-> *progress-carousell* int-backup))
|
||||
(set! (-> *misc-options* 0 value-to-modify) (&-> *pc-settings* discord-rpc?))
|
||||
(set! (-> *camera-options* 0 value-to-modify) (&-> *pc-settings* first-camera-hflip?))
|
||||
(set! (-> *camera-options* 1 value-to-modify) (&-> *pc-settings* first-camera-vflip?))
|
||||
(set! (-> *camera-options* 2 value-to-modify) (&-> *pc-settings* third-camera-hflip?))
|
||||
(set! (-> *camera-options* 3 value-to-modify) (&-> *pc-settings* third-camera-vflip?))
|
||||
(set! (-> *camera-options* 0 value-to-modify) (&-> *pc-settings* first-camera-h-inverted?))
|
||||
(set! (-> *camera-options* 1 value-to-modify) (&-> *pc-settings* first-camera-v-inverted?))
|
||||
(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?))
|
||||
(set! (-> *accessibility-options* 0 value-to-modify) (&-> *pc-settings* money-starburst?))
|
||||
(set! (-> *gfx-ps2-options* 0 value-to-modify) (&-> *progress-carousell* int-backup))
|
||||
(set! (-> *gfx-ps2-options* 1 value-to-modify) (&-> *progress-carousell* int-backup))
|
||||
@@ -610,7 +611,7 @@
|
||||
(case (-> options (-> obj option-index) option-type)
|
||||
(((game-option-type on-off)
|
||||
(game-option-type yes-no)
|
||||
(game-option-type normal-flipped)
|
||||
(game-option-type normal-inverted)
|
||||
(game-option-type aspect-native))
|
||||
;; pressed left on an on/off yes/no option
|
||||
(when (not (-> (the-as (pointer uint32) (-> options (-> obj option-index) value-to-modify))))
|
||||
@@ -727,7 +728,7 @@
|
||||
(case (-> options (-> obj option-index) option-type)
|
||||
(((game-option-type on-off)
|
||||
(game-option-type yes-no)
|
||||
(game-option-type normal-flipped)
|
||||
(game-option-type normal-inverted)
|
||||
(game-option-type aspect-native)
|
||||
)
|
||||
;; play sound if it was on 'yes' because we're going to 'no' now
|
||||
@@ -837,7 +838,7 @@
|
||||
(set! (-> (the-as (pointer language-enum) (-> options (-> obj option-index) value-to-modify)))
|
||||
(-> *progress-state* language-backup))
|
||||
)
|
||||
(((game-option-type on-off) (game-option-type normal-flipped))
|
||||
(((game-option-type on-off) (game-option-type normal-inverted))
|
||||
(set! (-> (the-as (pointer symbol) (-> options (-> obj option-index) value-to-modify)))
|
||||
(-> *progress-state* on-off-backup))
|
||||
)
|
||||
@@ -899,7 +900,12 @@
|
||||
(load-level-text-files (-> *level-task-data* (-> obj display-level-index) text-group-index))
|
||||
(set! (-> obj next-display-state) (progress-screen invalid))
|
||||
)
|
||||
(((game-text-id camera-controls-original))
|
||||
;; restore default camera controls
|
||||
(reset-original-camera *pc-settings*)
|
||||
(sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t)
|
||||
)
|
||||
)
|
||||
;; other behaviors are hardcoded elsewhere because screw you.
|
||||
)
|
||||
((= (-> options (-> obj option-index) option-type) (game-option-type resolution))
|
||||
@@ -943,7 +949,7 @@
|
||||
(((game-option-type language-subtitles))
|
||||
(set! (-> (the-as (pointer pc-subtitle-lang) (-> options (-> obj option-index) value-to-modify))) (-> *pc-settings* subtitle-language))
|
||||
)
|
||||
(((game-option-type on-off) (game-option-type normal-flipped))
|
||||
(((game-option-type on-off) (game-option-type normal-inverted))
|
||||
(set! (-> *progress-state* on-off-backup)
|
||||
(-> (the-as (pointer symbol) (-> options (-> obj option-index) value-to-modify))))
|
||||
)
|
||||
@@ -1174,20 +1180,20 @@
|
||||
(set! option-str (string-format "~D" (the int (-> (the-as (pointer float) (-> options index value-to-modify))))))
|
||||
(set! option-x (+ (the int (* 2.5 (-> (the-as (pointer float) (-> options index value-to-modify))))) -100))
|
||||
)
|
||||
(((game-option-type on-off) (game-option-type normal-flipped) (game-option-type aspect-native))
|
||||
(((game-option-type on-off) (game-option-type normal-inverted) (game-option-type aspect-native))
|
||||
;; on-off option or some other toggle. same logic as yes-no. changed to cut down code duping.
|
||||
(let (
|
||||
(on-str (case (-> options index option-type)
|
||||
(((game-option-type on-off) (game-option-type aspect-native))
|
||||
(lookup-text! *common-text* (game-text-id on) #f))
|
||||
(((game-option-type normal-flipped))
|
||||
(lookup-text! *common-text* (game-text-id normal) #f))
|
||||
(((game-option-type normal-inverted))
|
||||
(lookup-text! *common-text* (game-text-id inverted) #f))
|
||||
))
|
||||
(off-str (case (-> options index option-type)
|
||||
(((game-option-type on-off) (game-option-type aspect-native))
|
||||
(lookup-text! *common-text* (game-text-id off) #f))
|
||||
(((game-option-type normal-flipped))
|
||||
(lookup-text! *common-text* (game-text-id flipped) #f))
|
||||
(((game-option-type normal-inverted))
|
||||
(lookup-text! *common-text* (game-text-id normal) #f))
|
||||
))
|
||||
)
|
||||
(if (-> (the-as (pointer symbol) (-> options index value-to-modify)))
|
||||
@@ -1294,7 +1300,7 @@
|
||||
(game-option-type lod-bg)
|
||||
(game-option-type lod-fg)
|
||||
(game-option-type speaker)
|
||||
(game-option-type normal-flipped)
|
||||
(game-option-type normal-inverted)
|
||||
)
|
||||
;; slider and aspect ratio options just show their text
|
||||
(set! option-str (lookup-text! *common-text* (-> options index name) #f))
|
||||
|
||||
Reference in New Issue
Block a user