@@ -64,9 +64,7 @@ type SystemStateVars struct {
6464 envcol_time int32
6565
6666 scrrect [4 ]int32
67- gameWidth , gameHeight int32
68- gameWidthFloat float32 // Float forms used for precise screenpack math
69- gameHeightFloat float32 // TODO: rework gameWidth/gameHeight as floats instead
67+ gameWidth , gameHeight float32
7068 widthScale , heightScale float32
7169 gameEnd , frameSkip bool
7270 paused , frameStepFlag bool
@@ -356,7 +354,7 @@ type System struct {
356354}
357355
358356type drawAspectState struct {
359- gameWidth , gameHeight int32
357+ gameWidth , gameHeight float32
360358 widthScale , heightScale float32
361359}
362360
@@ -619,21 +617,17 @@ func (s *System) setGameSize(w, h int32) {
619617
620618 if screenAspect > targetAspect {
621619 // Screen is wider than 4:3 - scale based on height
622- s .gameWidthFloat = float32 (baseHeight ) * screenAspect
623- s .gameWidth = int32 (s .gameWidthFloat )
624- s .gameHeight = baseHeight
625- s .gameHeightFloat = float32 (s .gameHeight )
620+ s .gameWidth = float32 (baseHeight ) * screenAspect
621+ s .gameHeight = float32 (baseHeight )
626622 } else {
627623 // Screen is taller than 4:3 - scale based on width
628- s .gameWidth = baseWidth
629- s .gameWidthFloat = float32 (baseWidth )
630- s .gameHeightFloat = float32 (baseWidth ) / screenAspect
631- s .gameHeight = int32 (s .gameHeightFloat )
624+ s .gameWidth = float32 (baseWidth )
625+ s .gameHeight = float32 (baseWidth ) / screenAspect
632626 }
633627
634628 // Update scale
635- s .widthScale = float32 (s .scrrect [2 ]) / s .gameWidthFloat
636- s .heightScale = float32 (s .scrrect [3 ]) / s .gameHeightFloat
629+ s .widthScale = float32 (s .scrrect [2 ]) / s .gameWidth
630+ s .heightScale = float32 (s .scrrect [3 ]) / s .gameHeight
637631}
638632
639633// Change aspect ratio at match start
@@ -669,8 +663,8 @@ func (s *System) applyFightAspect() {
669663
670664 // Compute new game dimensions while maintaining the same base height
671665 gameWidth := baseHeight * aspectGame
672- s .gameWidth = int32 ( gameWidth )
673- s .gameHeight = int32 ( baseHeight )
666+ s .gameWidth = gameWidth
667+ s .gameHeight = baseHeight
674668
675669 // Scale to fit current screen size
676670 s .widthScale = float32 (s .scrrect [2 ]) / float32 (s .gameWidth )
0 commit comments