Camera inversion/flipped support for main first+third person cameras (#1355)

* Split cam inversion settings into first/third person settings. Connect settings to controls for main first/third person cameras

* inverted -> flipped everywhere

* cam-billy first-person camera impl

* respect camera inversion in cam-stick (debug option only), launcher cams

* refactor into common functions

* couple more cams

* tweak menu text and size, fix function ordering

* convert to macros, more descriptive names

* pc port comments

* one missed comment

* menu text/size/display tweaks

* respect flipped in main debug cam
This commit is contained in:
Matt Dallmeyer
2022-05-11 15:28:27 -07:00
committed by GitHub
parent f76f4fac63
commit 84b2ba43be
12 changed files with 231 additions and 174 deletions
+63 -61
View File
@@ -1305,66 +1305,68 @@
(europe #xf11)
;; extra IDs for pc port
(camera-options #x1000)
(normal #x1001)
(inverted #x1002)
(camera-controls-horz #x1003)
(camera-controls-vert #x1004)
(misc-options #x100f)
(accessibility-options #x1010)
(money-starburst #x1011)
(ps2-options #x1020)
(ps2-load-speed #x1021)
(ps2-parts #x1022)
(discord-rpc #x1030)
(display-mode #x1031)
(windowed #x1032)
(borderless #x1033)
(fullscreen #x1034)
(game-resolution #x1035)
(resolution-fmt #x1036)
(ps2-aspect-ratio #x1037)
(ps2-aspect-ratio-msg #x1038)
(aspect-ratio-ps2 #x1039)
(fit-to-screen #x103a)
(msaa #x1050)
(x-times-fmt #x1051)
(2-times #x1052)
(4-times #x1053)
(8-times #x1054)
(16-times #x1055)
(frame-rate #x1060)
(lod-bg #x1070)
(lod-fg #x1071)
(lod-highest #x1072)
(lod-high #x1073)
(lod-mid #x1074)
(lod-low #x1075)
(lod-lowest #x1076)
(lod-ps2 #x1077)
(subtitles #x1078)
(hinttitles #x1079)
(subtitles-language #x107a)
(subtitles-speaker #x107b)
(speaker-always #x107c)
(speaker-never #x107d)
(speaker-auto #x107e)
(hint-log #x107f)
(cheats #x1080)
(cheat-eco-blue #x1090)
(cheat-eco-red #x1091)
(cheat-eco-green #x1092)
(cheat-eco-yellow #x1093)
(cheat-sidekick-alt #x1094)
(cheat-invinc #x1095)
(music-player #x10c0)
(scene-player #x10c1)
(play-credits #x10c2)
(scrapbook #x10c3)
(scene-0 #x1100)
(scene-255 #x11ff)
(hint-0 #x1200)
(hint-511 #x13ff)
(camera-options #x1000)
(normal #x1001)
(flipped #x1002)
(camera-controls-first-horz #x1003)
(camera-controls-first-vert #x1004)
(camera-controls-third-horz #x1005)
(camera-controls-third-vert #x1006)
(misc-options #x100f)
(accessibility-options #x1010)
(money-starburst #x1011)
(ps2-options #x1020)
(ps2-load-speed #x1021)
(ps2-parts #x1022)
(discord-rpc #x1030)
(display-mode #x1031)
(windowed #x1032)
(borderless #x1033)
(fullscreen #x1034)
(game-resolution #x1035)
(resolution-fmt #x1036)
(ps2-aspect-ratio #x1037)
(ps2-aspect-ratio-msg #x1038)
(aspect-ratio-ps2 #x1039)
(fit-to-screen #x103a)
(msaa #x1050)
(x-times-fmt #x1051)
(2-times #x1052)
(4-times #x1053)
(8-times #x1054)
(16-times #x1055)
(frame-rate #x1060)
(lod-bg #x1070)
(lod-fg #x1071)
(lod-highest #x1072)
(lod-high #x1073)
(lod-mid #x1074)
(lod-low #x1075)
(lod-lowest #x1076)
(lod-ps2 #x1077)
(subtitles #x1078)
(hinttitles #x1079)
(subtitles-language #x107a)
(subtitles-speaker #x107b)
(speaker-always #x107c)
(speaker-never #x107d)
(speaker-auto #x107e)
(hint-log #x107f)
(cheats #x1080)
(cheat-eco-blue #x1090)
(cheat-eco-red #x1091)
(cheat-eco-green #x1092)
(cheat-eco-yellow #x1093)
(cheat-sidekick-alt #x1094)
(cheat-invinc #x1095)
(music-player #x10c0)
(scene-player #x10c1)
(play-credits #x10c2)
(scrapbook #x10c3)
(scene-0 #x1100)
(scene-255 #x11ff)
(hint-0 #x1200)
(hint-511 #x13ff)
;; GAME-TEXT-ID ENUM ENDS
)
@@ -15534,7 +15536,7 @@
(button 8)
;; extra types for pc port
(normal-inverted)
(normal-flipped)
(display-mode)
(msaa)
(frame-rate)
+10 -6
View File
@@ -8,12 +8,16 @@
"CAMERA OPTIONS")
(#x1001 "NORMAL"
"NORMAL")
(#x1002 "INVERTED"
"INVERTED")
(#x1003 "HORIZONTAL CAMERA CONTROL"
"HORIZONTAL CAMERA CONTROL")
(#x1004 "VERTICAL CAMERA CONTROL"
"VERTICAL CAMERA CONTROL")
(#x1002 "FLIPPED"
"FLIPPED")
(#x1003 "1ST-PERSON HORIZONTAL CAMERA"
"1ST-PERSON HORIZONTAL CAMERA")
(#x1004 "1ST-PERSON VERTICAL CAMERA"
"1ST-PERSON VERTICAL CAMERA")
(#x1005 "3RD-PERSON HORIZONTAL CAMERA"
"3RD-PERSON HORIZONTAL CAMERA")
(#x1006 "3RD-PERSON VERTICAL CAMERA"
"3RD-PERSON VERTICAL CAMERA")
(#x100f "MISCELLANEOUS"
"MISCELLANEOUS")
+2 -2
View File
@@ -295,8 +295,8 @@
(when *camera-read-analog*
(let ((f28-14 (analog-input (the-as int (-> *cpad-list* cpads arg3 leftx)) 128.0 48.0 110.0 -1.0))
(f30-14 (analog-input (the-as int (-> *cpad-list* cpads arg3 lefty)) 128.0 48.0 110.0 -1.0))
(f24-0 (analog-input (the-as int (-> *cpad-list* cpads arg3 rightx)) 128.0 48.0 110.0 -1.0))
(f26-0 (analog-input (the-as int (-> *cpad-list* cpads arg3 righty)) 128.0 48.0 110.0 -1.0))
(f24-0 (analog-input-horizontal-first (the-as int (-> *cpad-list* cpads arg3 rightx)) 128.0 48.0 110.0 -1.0)) ;; changed for pc port
(f26-0 (analog-input-vertical-first (the-as int (-> *cpad-list* cpads arg3 righty)) 128.0 48.0 110.0 -1.0)) ;; changed for pc port
)
(when *display-load-boundaries*
(when (and (!= arg3 1)
+19 -10
View File
@@ -433,6 +433,7 @@
(new 'static 'cam-eye-bank :rot-speed 364.0889 :max-degrees 12743.111 :max-fov 11650.845 :min-fov 6189.511)
)
;; main first-person camera
(defstate cam-eye (camera-slave)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
@@ -484,7 +485,7 @@
(s5-0 (new-stack-matrix0))
)
(when *camera-read-analog*
(let ((f30-0 (analog-input
(let ((f30-0 (analog-input-horizontal-first ;; changed for pc port
(the-as int (+ (-> *cpad-list* cpads 0 rightx) -256 (-> *cpad-list* cpads 0 leftx)))
(the-as float 0.0)
(the-as float 48.0)
@@ -492,7 +493,7 @@
(the-as float -1.0)
)
)
(f0-0 (analog-input
(f0-0 (analog-input-vertical-first ;; changed for pc port
(the-as int (+ (-> *cpad-list* cpads 0 righty) -256 (-> *cpad-list* cpads 0 lefty)))
(the-as float 0.0)
(the-as float 48.0)
@@ -607,6 +608,7 @@
(define *CAM_BILLY-bank* (new 'static 'cam-billy-bank :rot-speed 364.0889 :tilt-degrees -1820.4445))
;; first person camera for rat game
(defstate cam-billy (camera-slave)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
@@ -658,7 +660,7 @@
0.0
(when *camera-read-analog*
(let ((f1-0
(analog-input
(analog-input-horizontal-first ;; changed for pc port
(the-as int (+ (-> *cpad-list* cpads 0 rightx) -256 (-> *cpad-list* cpads 0 leftx)))
(the-as float 0.0)
(the-as float 48.0)
@@ -946,6 +948,7 @@
)
)
;; third person cam used to focus on various entities
(defbehavior cam-circular-position-into-max-angle camera-slave ((arg0 vector) (arg1 vector) (arg2 float))
(let* ((f30-0 (vector-normalize-ret-len! arg0 (the-as float 1.0)))
(f26-0 (vector-normalize-ret-len! arg1 (the-as float 1.0)))
@@ -954,7 +957,7 @@
(s3-0 (new 'stack-no-clear 'matrix))
)
(when *camera-read-analog*
(let ((f24-0 (analog-input
(let ((f24-0 (analog-input-horizontal-third ;; changed for pc port
(the-as int (-> *cpad-list* cpads 0 rightx))
(the-as float 128.0)
(the-as float 32.0)
@@ -962,7 +965,7 @@
(* 8192.0 (-> *display* seconds-per-frame))
)
)
(f1-2 (analog-input
(f1-2 (analog-input-vertical-third ;; changed for pc port
(the-as int (-> *cpad-list* cpads 0 righty))
(the-as float 128.0)
(the-as float 32.0)
@@ -2324,11 +2327,16 @@
((< 160 arg0)
(set! f0-0 (fmin arg1 (* 0.0125 (+ -160.0 (the float arg0)) arg1)))
)
)
f0-0
)
;; changed for pc port, only used for Third-Person Vertical camera
(*
(if (and PC_PORT (-> *pc-settings* third-camera-vflip?)) 1.0 -1.0)
f0-0
)
)
)
;; main third-person camera
(defbehavior cam-string-joystick camera-slave ()
(set! (-> self options) (logand -257 (-> self options)))
(let ((f28-0 (cam-dist-analog-input (the-as int (-> *cpad-list* cpads 0 righty)) (the-as float 0.05)))
@@ -2419,7 +2427,7 @@
)
)
(when *camera-read-analog*
(let ((f0-29 (analog-input
(let ((f0-29 (analog-input-horizontal-third ;; changed for pc port
(the-as int (-> *cpad-list* cpads 0 rightx))
(the-as float 128.0)
(the-as float 32.0)
@@ -3098,6 +3106,7 @@
(none)
)
;; third person camera (in debug menu, and fishermans-boat-player-control w/o autopilot?)
(defstate cam-stick (camera-slave)
:event
cam-standard-event-handler
@@ -3134,7 +3143,7 @@
(when (not (paused?))
(when *camera-read-analog*
(let ((f0-0
(analog-input
(analog-input-vertical-third ;; changed for pc port
(the-as int (-> *cpad-list* cpads 0 righty))
(the-as float 128.0)
(the-as float 32.0)
@@ -3163,7 +3172,7 @@
(lerp (-> *CAM_STICK-bank* min-z) (-> *CAM_STICK-bank* max-z) (-> self view-off-param))
)
(when *camera-read-analog*
(let ((f0-16 (analog-input
(let ((f0-16 (analog-input-horizontal-third ;; changed for pc port
(the-as int (-> *cpad-list* cpads 0 rightx))
(the-as float 128.0)
(the-as float 32.0)
+4 -2
View File
@@ -1763,12 +1763,13 @@
)
)
;; unused blue eco(?) launcher cam
(defbehavior cam-launcher-joystick camera-slave ()
(when *camera-read-analog*
(let ((s5-0 (new-stack-matrix0))
(gp-0 (vector-reset! (new 'stack-no-clear 'vector)))
)
(let* ((f0-0 (analog-input (the-as int (+ (-> *cpad-list* cpads 0 rightx) -128)) 0.0 48.0 110.0 -1.0))
(let* ((f0-0 (analog-input-horizontal-third (the-as int (+ (-> *cpad-list* cpads 0 rightx) -128)) 0.0 48.0 110.0 -1.0)) ;; changed for pc port
(f1-1 (* -546.13336 f0-0))
(f0-2 (fmin 546.13336 (fmax -546.13336 f1-1)))
)
@@ -1840,10 +1841,11 @@
)
)
;; blue eco launcher cam (not used for enclosed launchers like in jungle temple)
(defbehavior cam-launcher-long-joystick camera-slave ()
(when *camera-read-analog*
(let ((gp-0 (new-stack-matrix0)))
(let* ((f0-0 (analog-input (the-as int (+ (-> *cpad-list* cpads 0 rightx) -128)) 0.0 48.0 110.0 -1.0))
(let* ((f0-0 (analog-input-horizontal-third (the-as int (+ (-> *cpad-list* cpads 0 rightx) -128)) 0.0 48.0 110.0 -1.0)) ;; changed for pc port
(f1-1 (* -546.13336 f0-0))
(f0-2 (fmin 546.13336 (fmax -546.13336 f1-1)))
)
+32
View File
@@ -200,6 +200,38 @@
)
)
(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 (and PC_PORT (-> *pc-settings* first-camera-vflip?)) 1.0 -1.0)
(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 (and PC_PORT (-> *pc-settings* first-camera-hflip?)) 1.0 -1.0)
(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 (and PC_PORT (-> *pc-settings* third-camera-vflip?)) 1.0 -1.0)
(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 (and PC_PORT (-> *pc-settings* third-camera-hflip?)) 1.0 -1.0)
(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."
(cond
+1 -1
View File
@@ -136,7 +136,7 @@
(button 8)
;; extra types for pc port
(normal-inverted)
(normal-flipped)
(display-mode)
(msaa)
(frame-rate)
+62 -60
View File
@@ -457,66 +457,68 @@
(europe #xf11)
;; extra IDs for pc port
(camera-options #x1000)
(normal #x1001)
(inverted #x1002)
(camera-controls-horz #x1003)
(camera-controls-vert #x1004)
(misc-options #x100f)
(accessibility-options #x1010)
(money-starburst #x1011)
(ps2-options #x1020)
(ps2-load-speed #x1021)
(ps2-parts #x1022)
(discord-rpc #x1030)
(display-mode #x1031)
(windowed #x1032)
(borderless #x1033)
(fullscreen #x1034)
(game-resolution #x1035)
(resolution-fmt #x1036)
(ps2-aspect-ratio #x1037)
(ps2-aspect-ratio-msg #x1038)
(aspect-ratio-ps2 #x1039)
(fit-to-screen #x103a)
(msaa #x1050)
(x-times-fmt #x1051)
(2-times #x1052)
(4-times #x1053)
(8-times #x1054)
(16-times #x1055)
(frame-rate #x1060)
(lod-bg #x1070)
(lod-fg #x1071)
(lod-highest #x1072)
(lod-high #x1073)
(lod-mid #x1074)
(lod-low #x1075)
(lod-lowest #x1076)
(lod-ps2 #x1077)
(subtitles #x1078)
(hinttitles #x1079)
(subtitles-language #x107a)
(subtitles-speaker #x107b)
(speaker-always #x107c)
(speaker-never #x107d)
(speaker-auto #x107e)
(hint-log #x107f)
(cheats #x1080)
(cheat-eco-blue #x1090)
(cheat-eco-red #x1091)
(cheat-eco-green #x1092)
(cheat-eco-yellow #x1093)
(cheat-sidekick-alt #x1094)
(cheat-invinc #x1095)
(music-player #x10c0)
(scene-player #x10c1)
(play-credits #x10c2)
(scrapbook #x10c3)
(scene-0 #x1100)
(scene-255 #x11ff)
(hint-0 #x1200)
(hint-511 #x13ff)
(camera-options #x1000)
(normal #x1001)
(flipped #x1002)
(camera-controls-first-horz #x1003)
(camera-controls-first-vert #x1004)
(camera-controls-third-horz #x1005)
(camera-controls-third-vert #x1006)
(misc-options #x100f)
(accessibility-options #x1010)
(money-starburst #x1011)
(ps2-options #x1020)
(ps2-load-speed #x1021)
(ps2-parts #x1022)
(discord-rpc #x1030)
(display-mode #x1031)
(windowed #x1032)
(borderless #x1033)
(fullscreen #x1034)
(game-resolution #x1035)
(resolution-fmt #x1036)
(ps2-aspect-ratio #x1037)
(ps2-aspect-ratio-msg #x1038)
(aspect-ratio-ps2 #x1039)
(fit-to-screen #x103a)
(msaa #x1050)
(x-times-fmt #x1051)
(2-times #x1052)
(4-times #x1053)
(8-times #x1054)
(16-times #x1055)
(frame-rate #x1060)
(lod-bg #x1070)
(lod-fg #x1071)
(lod-highest #x1072)
(lod-high #x1073)
(lod-mid #x1074)
(lod-low #x1075)
(lod-lowest #x1076)
(lod-ps2 #x1077)
(subtitles #x1078)
(hinttitles #x1079)
(subtitles-language #x107a)
(subtitles-speaker #x107b)
(speaker-always #x107c)
(speaker-never #x107d)
(speaker-auto #x107e)
(hint-log #x107f)
(cheats #x1080)
(cheat-eco-blue #x1090)
(cheat-eco-red #x1091)
(cheat-eco-green #x1092)
(cheat-eco-yellow #x1093)
(cheat-sidekick-alt #x1094)
(cheat-invinc #x1095)
(music-player #x10c0)
(scene-player #x10c1)
(play-credits #x10c2)
(scrapbook #x10c3)
(scene-0 #x1100)
(scene-255 #x11ff)
(hint-0 #x1200)
(hint-511 #x13ff)
;; GAME-TEXT-ID ENUM ENDS
)
+3 -2
View File
@@ -654,6 +654,7 @@
:longest-edge (meters 0)
)
;; jungle eco connector first-person cam
(defstate cam-periscope (camera-slave)
:event
cam-standard-event-handler
@@ -694,7 +695,7 @@
(when (not (or (paused?) (-> (the-as periscope (-> self change-event-from 0)) aligned?)))
(vector-reset! s5-0)
(when *camera-read-analog*
(let ((f26-0 (analog-input
(let ((f26-0 (analog-input-horizontal-first ;; changed for pc port
(the-as int (+ (-> *cpad-list* cpads 0 rightx) -256 (-> *cpad-list* cpads 0 leftx)))
0.0
48.0
@@ -702,7 +703,7 @@
-1.0
)
)
(f0-0 (analog-input
(f0-0 (analog-input-vertical-first ;; changed for pc port
(the-as int (+ (-> *cpad-list* cpads 0 righty) -256 (-> *cpad-list* cpads 0 lefty)))
0.0
48.0
+8 -4
View File
@@ -269,8 +269,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)
(camera-hflip? symbol) ;; horizontal camera invert
(camera-vflip? symbol) ;; vertical camera invert
(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
(money-starburst? symbol) ;; add a starburst to the money
(fixes pc-fixes :inline) ;; extra game fixes
@@ -444,8 +446,10 @@
(set! (-> obj hinttitles?) #t)
(set! (-> obj subtitle-speaker?) 'auto)
(set! (-> obj subtitle-language) (pc-subtitle-lang english))
(set! (-> obj camera-hflip?) #f)
(set! (-> obj camera-vflip?) #f)
(set! (-> obj first-camera-hflip?) #f)
(set! (-> obj first-camera-vflip?) #f)
(set! (-> obj third-camera-hflip?) #f)
(set! (-> obj third-camera-vflip?) #f)
(set! (-> obj money-starburst?) #f)
(none))
+8 -4
View File
@@ -541,8 +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)))
(("camera-hflip?") (set! (-> obj camera-hflip?) (file-stream-read-symbol file)))
(("camera-vflip?") (set! (-> obj camera-vflip?) (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)))
(("money-starburst?") (set! (-> obj money-starburst?) (file-stream-read-symbol file)))
(("scenes-seen")
(dotimes (i 197)
@@ -660,8 +662,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 " (camera-hflip? ~A)~%" (-> obj camera-hflip?))
(format file " (camera-vflip? ~A)~%" (-> obj camera-vflip?))
(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 " (money-starburst? ~A)~%" (-> obj money-starburst?))
(format file " (force-actors? ~A)~%" (-> obj force-actors?))
(format file " (subtitles? ~A)~%" (-> obj subtitles?))
+19 -22
View File
@@ -155,9 +155,11 @@
)
(define *camera-options*
(new 'static 'boxed-array :type game-option :length 3 :allocated-length 3
(new 'static 'game-option :option-type (game-option-type normal-inverted) :name (game-text-id camera-controls-horz) :scale #t)
(new 'static 'game-option :option-type (game-option-type normal-inverted) :name (game-text-id camera-controls-vert) :scale #t)
(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 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t)
)
)
@@ -506,8 +508,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* camera-hflip?))
(set! (-> *camera-options* 1 value-to-modify) (&-> *pc-settings* camera-vflip?))
(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! (-> *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))
@@ -606,7 +610,7 @@
(case (-> options (-> obj option-index) option-type)
(((game-option-type on-off)
(game-option-type yes-no)
(game-option-type normal-inverted)
(game-option-type normal-flipped)
(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))))
@@ -723,7 +727,7 @@
(case (-> options (-> obj option-index) option-type)
(((game-option-type on-off)
(game-option-type yes-no)
(game-option-type normal-inverted)
(game-option-type normal-flipped)
(game-option-type aspect-native)
)
;; play sound if it was on 'yes' because we're going to 'no' now
@@ -833,7 +837,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-inverted))
(((game-option-type on-off) (game-option-type normal-flipped))
(set! (-> (the-as (pointer symbol) (-> options (-> obj option-index) value-to-modify)))
(-> *progress-state* on-off-backup))
)
@@ -939,7 +943,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-inverted))
(((game-option-type on-off) (game-option-type normal-flipped))
(set! (-> *progress-state* on-off-backup)
(-> (the-as (pointer symbol) (-> options (-> obj option-index) value-to-modify))))
)
@@ -1170,20 +1174,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-inverted) (game-option-type aspect-native))
(((game-option-type on-off) (game-option-type normal-flipped) (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-inverted))
(((game-option-type normal-flipped))
(lookup-text! *common-text* (game-text-id normal) #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-inverted))
(lookup-text! *common-text* (game-text-id inverted) #f))
(((game-option-type normal-flipped))
(lookup-text! *common-text* (game-text-id flipped) #f))
))
)
(if (-> (the-as (pointer symbol) (-> options index value-to-modify)))
@@ -1290,6 +1294,7 @@
(game-option-type lod-bg)
(game-option-type lod-fg)
(game-option-type speaker)
(game-option-type normal-flipped)
)
;; slider and aspect ratio options just show their text
(set! option-str (lookup-text! *common-text* (-> options index name) #f))
@@ -1302,14 +1307,6 @@
(lookup-text! *common-text* (game-text-id off) #f)
)))
)
(((game-option-type normal-inverted))
;; etc
(set! option-str (string-format "~S: ~S" (lookup-text! *common-text* (-> options index name) #f)
(if (-> (the-as (pointer uint32) (-> options index value-to-modify)))
(lookup-text! *common-text* (game-text-id normal) #f)
(lookup-text! *common-text* (game-text-id inverted) #f)
)))
)
(((game-option-type language))
;; language options show their text + language name
(set! option-str (string-format "~S: ~S" (lookup-text! *common-text* (-> options index name) #f)
@@ -1424,7 +1421,7 @@
(((progress-screen camera-options))
;; camera options lines are a bit too big
(hide-progress-icons)
(draw-options self 115 36 0.77)
(draw-options self 125 30 0.65)
)
(((progress-screen gfx-ps2-options))
(hide-progress-icons)