[jak2] minimap improvements (#2929)

Smoothens minimap icon motion and fixes the target icon being squished
depending on the angle it's facing.
This commit is contained in:
ManDude 2023-08-22 18:14:03 +01:00 committed by GitHub
parent 04269ffa86
commit 329f13b610
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 7 deletions

View file

@ -432,7 +432,7 @@
)
(cheats-sound-play *progress-cheat*)
)
(check-cheat-code (-> *cheat-temp* 5) 1
(check-cheat-code (-> *cheat-temp* 4) 1 ;; note : this erroneously uses (-> *cheat-temp* 5) in the original game
(triangle x circle square triangle x circle square)
(cpad-clear! 0 r1)
(set! *cheat-mode* (if (= *cheat-mode* 'camera)

View file

@ -2133,24 +2133,24 @@
(cond
((-> *blit-displays-work* horizontal-flip-flag)
(let ((v1-35 (-> arg0 mat)))
(set! (-> v1-35 vector 0 x) (* (-> sv-52 vector 0 z) (- f30-0)))
(set! (-> v1-35 vector 0 x) (* (-> sv-52 vector 0 z) (- (#if PC_PORT 1.0 f30-0))))
(set! (-> v1-35 vector 0 y) 0.0)
(set! (-> v1-35 vector 0 z) (- (-> sv-52 vector 0 x)))
(set! (-> v1-35 vector 0 w) 0.0)
)
(set-vector! (-> arg0 mat vector 1) 0.0 1.0 0.0 0.0)
(set-vector! (-> arg0 mat vector 2) (* (-> sv-52 vector 0 x) (- f30-0)) 0.0 (-> sv-52 vector 0 z) 0.0)
(set-vector! (-> arg0 mat vector 2) (* (-> sv-52 vector 0 x) (- (#if PC_PORT 1.0 f30-0))) 0.0 (-> sv-52 vector 0 z) 0.0)
(set-vector! (-> arg0 mat trans) 0.0 0.0 (the float (+ (-> arg0 draw-pos y) 1896)) 1.0)
)
(else
(let ((v1-39 (-> arg0 mat)))
(set! (-> v1-39 vector 0 x) (* (-> sv-52 vector 0 z) f30-0))
(set! (-> v1-39 vector 0 x) (* (-> sv-52 vector 0 z) (#if PC_PORT 1.0 f30-0)))
(set! (-> v1-39 vector 0 y) 0.0)
(set! (-> v1-39 vector 0 z) (- (-> sv-52 vector 0 x)))
(set! (-> v1-39 vector 0 w) 0.0)
)
(set-vector! (-> arg0 mat vector 1) 0.0 1.0 0.0 0.0)
(set-vector! (-> arg0 mat vector 2) (* (-> sv-52 vector 0 x) f30-0) 0.0 (-> sv-52 vector 0 z) 0.0)
(set-vector! (-> arg0 mat vector 2) (* (-> sv-52 vector 0 x) (#if PC_PORT 1.0 f30-0)) 0.0 (-> sv-52 vector 0 z) 0.0)
(set-vector! (-> arg0 mat trans) 0.0 0.0 (the float (+ (-> arg0 draw-pos y) 1896)) 1.0)
)
)
@ -2232,6 +2232,11 @@
)
)
)
(#when PC_PORT
;; revert widescreen correction done earlier
(*! (-> arg0 mat vector 0 x) f30-0)
(*! (-> arg0 mat vector 2 x) f30-0)
)
)
(set! (-> arg0 buf) s5-0)
)
@ -2450,6 +2455,14 @@
)
(set! (-> arg0 corner 0 x) (the float (the int (- (-> s3-2 x) (* 0.5 f1-16)))))
(set! (-> arg0 corner 0 z) (the float (the int (- (-> s3-2 z) (* 0.5 f0-49)))))
(#when PC_PORT
;; pc port note : don't align icons to PS2 framebuffer positions since
;; it results in jagged motion on PC, since the framebuffer can be any size we want
(when (-> *pc-settings* smooth-minimap?)
(set! (-> arg0 corner 0 x) (- (-> s3-2 x) (* 0.5 f1-16)))
(set! (-> arg0 corner 0 z) (- (-> s3-2 z) (* 0.5 f0-49)))
)
)
(set! (-> arg0 corner 1 x) (+ (-> arg0 corner 0 x) f1-16))
(set! (-> arg0 corner 1 z) (+ (-> arg0 corner 0 z) f0-49))
)

View file

@ -11,8 +11,8 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; version: 0.1.1.2
(defconstant PC_KERNEL_VERSION (static-pckernel-version 0 1 1 2))
;; version: 0.1.2.2
(defconstant PC_KERNEL_VERSION (static-pckernel-version 0 1 2 2))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; types and enums
@ -83,9 +83,12 @@
(music-unlocked bit-array)
(flava-unlocked symbol 6)
;; misc
(fast-airlock? symbol)
(fast-elevator? symbol)
(fast-progress? symbol)
(smooth-minimap? symbol)
(text-language pc-language) ;; language for game text
@ -132,6 +135,7 @@
(set! (-> obj fast-airlock?) #t)
(set! (-> obj fast-elevator?) #t)
(set! (-> obj fast-progress?) #f)
(set! (-> obj smooth-minimap?) #t)
0)
(defmethod reset-extra pc-settings-jak2 ((obj pc-settings-jak2) (call-handlers symbol))

View file

@ -225,6 +225,7 @@
'ctygena 'ctygenb 'ctygenc 'ctyport
'ctymarka 'ctymarkb 'ctyfarma 'ctyfarmb
'ctyinda 'ctyindb 'stadium) #t)
;; also allow in forest
(('forest) #t #|(not (task-node-open? (game-task-node forest-scouts-pegasus)))|#)))
(set-setting! 'string-spline-max-move 'abs (* (-> *pc-cheat-state* turbo-board-speed) (meters 2)) 0)
(set-setting! 'string-spline-accel 'abs (* (-> *pc-cheat-state* turbo-board-speed) (meters 0.045)) 0)
@ -308,6 +309,7 @@
(("fast-airlock?") (set! (-> obj fast-airlock?) (file-stream-read-symbol file)))
(("fast-elevator?") (set! (-> obj fast-elevator?) (file-stream-read-symbol file)))
(("fast-progress?") (set! (-> obj fast-progress?) (file-stream-read-symbol file)))
(("smooth-minimap?") (set! (-> obj smooth-minimap?) (file-stream-read-symbol file)))
(("text-language") (set! (-> obj text-language) (the-as pc-language (file-stream-read-int file))))
(("cheats") (set! (-> obj cheats) (the-as pc-cheats (file-stream-read-int file))))
(("cheats-revealed") (set! (-> obj cheats-revealed) (the-as pc-cheats (file-stream-read-int file))))
@ -333,6 +335,7 @@
(format file " (fast-airlock? ~A)~%" (-> obj fast-airlock?))
(format file " (fast-elevator? ~A)~%" (-> obj fast-elevator?))
(format file " (fast-progress? ~A)~%" (-> obj fast-progress?))
(format file " (smooth-minimap? ~A)~%" (-> obj smooth-minimap?))
(format file " (text-language ~D)~%" (-> obj text-language))
(format file " (cheats #x~x)~%" (-> obj cheats))
(format file " (cheats-revealed #x~x)~%" (-> obj cheats-revealed))