jak-project/goal_src/engine/game/video.gc

89 lines
3 KiB
Common Lisp
Raw Normal View History

;;-*-Lisp-*-
2020-09-04 14:44:23 -04:00
(in-package goal)
;; name: video.gc
;; name in dgo: video
;; dgos: GAME, ENGINE
;; DECOMP BEGINS
(defun set-video-mode ((arg0 symbol))
(case arg0
(('ntsc)
(set! (-> *video-parms* screen-sy) 224)
(set! (-> *setting-control* default screenx) 0)
(set! (-> *setting-control* default screeny) 8)
(set! (-> *video-parms* screen-pages-high) 7)
(set! (-> *video-parms* relative-y-scale) 1.0)
(set! *ticks-per-frame* 9765) ;; 585900 total?
(set! (-> *math-camera* isometric vector 1 y) 0.5)
(set! (-> *math-camera* y-pix) 112.0)
(set! (-> *math-camera* y-clip) 448.0)
(set! (-> *shadow-data* texoffset y) 112.5)
)
(('pal)
(set! (-> *video-parms* screen-sy) 256)
(set! (-> *setting-control* default screenx) 0)
(set! (-> *setting-control* default screeny) 24)
(set! (-> *video-parms* screen-pages-high) 8)
(set! (-> *video-parms* relative-y-scale) 1.1428572)
(set! *ticks-per-frame* 11718)
(set! (-> *math-camera* isometric vector 1 y) 0.4375)
(set! (-> *math-camera* y-pix) 128.0)
(set! (-> *math-camera* y-clip) 512.0)
(set! (-> *shadow-data* texoffset y) 128.5)
)
)
(set-time-ratios *display* (-> *display* time-ratio))
(set! (-> *video-parms* reset-video-mode) #t)
(set! (-> *video-parms* screen-hy) (/ (-> *video-parms* screen-sy) 2))
(set! (-> *video-parms* screen-miny) (- 2048 (-> *video-parms* screen-hy)))
(set! (-> *video-parms* screen-maxy) (+ (-> *video-parms* screen-hy) 2048))
(set! (-> *video-parms* screen-masky) (+ (-> *video-parms* screen-sy) -1))
(set! (-> *pause-context* origin y) (the float (+ (-> *video-parms* screen-sy) -54)))
(set! (-> *pause-context* height) (the float (-> *video-parms* screen-sy)))
(set! (-> *font-default-matrix* vector 1 y) (-> *video-parms* relative-y-scale))
(set! (-> *font-default-matrix* vector 3 y) (- (the float (-> *video-parms* screen-hy))))
(set! (-> *video-parms* relative-y-scale-reciprical) 1.0)
(set! *profile-y* (+ (-> *video-parms* screen-miny) 8))
(set! (-> *video-parms* set-video-mode) #t)
(set-hud-aspect-ratio (get-aspect-ratio) arg0)
(if *progress-process*
(adjust-ratios (-> *progress-process* 0) (get-aspect-ratio) arg0)
)
0
(none)
)
(defun get-video-mode ()
(-> *setting-control* current video-mode)
)
(defun set-aspect-ratio ((arg0 symbol))
(case arg0
(('aspect4x3)
(set! (-> *video-parms* relative-x-scale) 1.0)
(set! (-> *video-parms* relative-x-scale-reciprical) 1.0)
)
(('aspect16x9)
(set! (-> *video-parms* relative-x-scale) 0.75)
(set! (-> *video-parms* relative-x-scale-reciprical) 1.3333334)
)
)
(set! (-> *font-default-matrix* vector 0 x) (-> *video-parms* relative-x-scale))
(set-hud-aspect-ratio arg0 (get-video-mode))
(if *progress-process*
(adjust-ratios (-> *progress-process* 0) arg0 (get-video-mode))
)
0
(none)
)
(defun get-aspect-ratio ()
(-> *setting-control* current aspect-ratio)
)