fix aspect ratio

This commit is contained in:
BatteryRock 2025-02-10 20:49:26 -05:00
parent 5c1e0dcb84
commit 02ab59bacd
3 changed files with 4 additions and 4 deletions

View File

@ -12,7 +12,7 @@ aux-display tinydisplay
depth-bits 24
audio-sfx-active #t
audio-music-active #t
#aspect-ratio 1.333333
aspect-ratio 1.777778
framebuffer-hardware #t
multisamples 4

View File

@ -55,7 +55,7 @@ class ToonBase(OTPBase.OTPBase):
self.wantDynamicShadows = 0
self.exitErrorCode = 0
camera.setPosHpr(0, 0, 0, 0, 0, 0)
self.camLens.setMinFov(ToontownGlobals.DefaultCameraFov / (4. / 3.))
self.camLens.setMinFov(ToontownGlobals.DefaultCameraFov / base.getAspectRatio())
self.camLens.setNearFar(ToontownGlobals.DefaultCameraNear, ToontownGlobals.DefaultCameraFar)
self.musicManager.setVolume(0.65)
self.setBackgroundColor(ToontownGlobals.DefaultBackgroundColor)
@ -146,7 +146,7 @@ class ToonBase(OTPBase.OTPBase):
self.walking = 0
self.oldX = max(1, base.win.getXSize())
self.oldY = max(1, base.win.getYSize())
self.aspectRatio = float(self.oldX) / self.oldY
self.aspectRatio = base.getAspectRatio()
return
def windowEvent(self, win):

View File

@ -63,7 +63,7 @@ ConfigVariableDouble('decompressor-step-time').setValue(0.01)
ConfigVariableDouble('extractor-step-time').setValue(0.01)
backgroundNodePath = aspect2d.attachNewNode(backgroundNode, 0)
backgroundNodePath.setPos(0.0, 0.0, 0.0)
backgroundNodePath.setScale(base.aspect2d, VBase3(1.33, 1, 1))
backgroundNodePath.setScale(base.aspect2d, VBase3(base.getAspectRatio(), 1, 1))
backgroundNodePath.find('**/fg').setBin('fixed', 20)
backgroundNodePath.find('**/bg').setBin('fixed', 10)
backgroundNodePath.find('**/bg').setScale(base.aspect2d, VBase3(base.getAspectRatio(), 1, 1))