From b83a0d469af25f9756698378e6e928abaa4ec7d0 Mon Sep 17 00:00:00 2001 From: _AG Date: Sun, 16 Jun 2019 00:20:55 +0200 Subject: Updates Draw.cpp, MusicManager.cpp. --- src/main.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 9b8fc145..38666979 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -86,6 +86,7 @@ RwRGBA gColourTop; void Idle(void *arg) { + CDraw::CalculateAspectRatio(); CTimer::Update(); CSprite2d::InitPerFrame(); CFont::InitPerFrame(); @@ -141,7 +142,7 @@ Idle(void *arg) }else{ float viewWindow = tan(DEGTORAD(CDraw::GetFOV() * 0.5f)); // ASPECT - CameraSize(Scene.camera, nil, viewWindow, 4.0f/3.0f); + CameraSize(Scene.camera, nil, viewWindow, SCREEN_ASPECT_RATIO); CVisibilityPlugins::SetRenderWareCamera(Scene.camera); RwCameraClear(Scene.camera, &gColourTop, rwCAMERACLEARZ); if(!RsCameraBeginUpdate(Scene.camera)) @@ -161,6 +162,7 @@ Idle(void *arg) void FrontendIdle(void) { + CDraw::CalculateAspectRatio(); CTimer::Update(); CSprite2d::SetRecipNearClip(); CSprite2d::InitPerFrame(); @@ -173,7 +175,7 @@ FrontendIdle(void) float viewWindow = tan(DEGTORAD(CDraw::GetFOV() * 0.5f)); // ASPECT - CameraSize(Scene.camera, nil, viewWindow, 4.0f/3.0f); + CameraSize(Scene.camera, nil, viewWindow, SCREEN_ASPECT_RATIO); CVisibilityPlugins::SetRenderWareCamera(Scene.camera); RwCameraClear(Scene.camera, &gColourTop, rwCAMERACLEARZ); if(!RsCameraBeginUpdate(Scene.camera)) @@ -190,13 +192,13 @@ FrontendIdle(void) bool DoRWStuffStartOfFrame(int16 TopRed, int16 TopGreen, int16 TopBlue, int16 BottomRed, int16 BottomGreen, int16 BottomBlue, int16 Alpha) { + CDraw::CalculateAspectRatio(); CRGBA TopColor(TopRed, TopGreen, TopBlue, Alpha); CRGBA BottomColor(BottomRed, BottomGreen, BottomBlue, Alpha); float viewWindow = tan(DEGTORAD(CDraw::GetFOV() * 0.5f)); // ASPECT - float aspectRatio = CMenuManager::m_PrefsUseWideScreen ? 16.0f/9.0f : 4.0f/3.0f; - CameraSize(Scene.camera, nil, viewWindow, aspectRatio); + CameraSize(Scene.camera, nil, viewWindow, SCREEN_ASPECT_RATIO); CVisibilityPlugins::SetRenderWareCamera(Scene.camera); RwCameraClear(Scene.camera, &gColourTop, rwCAMERACLEARZ); @@ -214,10 +216,10 @@ DoRWStuffStartOfFrame(int16 TopRed, int16 TopGreen, int16 TopBlue, int16 BottomR bool DoRWStuffStartOfFrame_Horizon(int16 TopRed, int16 TopGreen, int16 TopBlue, int16 BottomRed, int16 BottomGreen, int16 BottomBlue, int16 Alpha) { + CDraw::CalculateAspectRatio(); float viewWindow = tan(DEGTORAD(CDraw::GetFOV() * 0.5f)); // ASPECT - float aspectRatio = CMenuManager::m_PrefsUseWideScreen ? 16.0f/9.0f : 4.0f/3.0f; - CameraSize(Scene.camera, nil, viewWindow, aspectRatio); + CameraSize(Scene.camera, nil, viewWindow, SCREEN_ASPECT_RATIO); CVisibilityPlugins::SetRenderWareCamera(Scene.camera); RwCameraClear(Scene.camera, &gColourTop, rwCAMERACLEARZ); -- cgit v1.2.3 From 2a207af49a922fe65bb3e69489aa3e075b72c3e3 Mon Sep 17 00:00:00 2001 From: aap Date: Sun, 16 Jun 2019 19:06:01 +0200 Subject: some cleanup --- src/main.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 38666979..976de407 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -86,7 +86,6 @@ RwRGBA gColourTop; void Idle(void *arg) { - CDraw::CalculateAspectRatio(); CTimer::Update(); CSprite2d::InitPerFrame(); CFont::InitPerFrame(); @@ -141,7 +140,7 @@ Idle(void *arg) Render2dStuff(); }else{ float viewWindow = tan(DEGTORAD(CDraw::GetFOV() * 0.5f)); - // ASPECT + CDraw::CalculateAspectRatio(); CameraSize(Scene.camera, nil, viewWindow, SCREEN_ASPECT_RATIO); CVisibilityPlugins::SetRenderWareCamera(Scene.camera); RwCameraClear(Scene.camera, &gColourTop, rwCAMERACLEARZ); @@ -162,7 +161,6 @@ Idle(void *arg) void FrontendIdle(void) { - CDraw::CalculateAspectRatio(); CTimer::Update(); CSprite2d::SetRecipNearClip(); CSprite2d::InitPerFrame(); @@ -174,7 +172,7 @@ FrontendIdle(void) return; float viewWindow = tan(DEGTORAD(CDraw::GetFOV() * 0.5f)); - // ASPECT + CDraw::CalculateAspectRatio(); CameraSize(Scene.camera, nil, viewWindow, SCREEN_ASPECT_RATIO); CVisibilityPlugins::SetRenderWareCamera(Scene.camera); RwCameraClear(Scene.camera, &gColourTop, rwCAMERACLEARZ); @@ -192,12 +190,11 @@ FrontendIdle(void) bool DoRWStuffStartOfFrame(int16 TopRed, int16 TopGreen, int16 TopBlue, int16 BottomRed, int16 BottomGreen, int16 BottomBlue, int16 Alpha) { - CDraw::CalculateAspectRatio(); CRGBA TopColor(TopRed, TopGreen, TopBlue, Alpha); CRGBA BottomColor(BottomRed, BottomGreen, BottomBlue, Alpha); float viewWindow = tan(DEGTORAD(CDraw::GetFOV() * 0.5f)); - // ASPECT + CDraw::CalculateAspectRatio(); CameraSize(Scene.camera, nil, viewWindow, SCREEN_ASPECT_RATIO); CVisibilityPlugins::SetRenderWareCamera(Scene.camera); RwCameraClear(Scene.camera, &gColourTop, rwCAMERACLEARZ); @@ -216,9 +213,8 @@ DoRWStuffStartOfFrame(int16 TopRed, int16 TopGreen, int16 TopBlue, int16 BottomR bool DoRWStuffStartOfFrame_Horizon(int16 TopRed, int16 TopGreen, int16 TopBlue, int16 BottomRed, int16 BottomGreen, int16 BottomBlue, int16 Alpha) { - CDraw::CalculateAspectRatio(); float viewWindow = tan(DEGTORAD(CDraw::GetFOV() * 0.5f)); - // ASPECT + CDraw::CalculateAspectRatio(); CameraSize(Scene.camera, nil, viewWindow, SCREEN_ASPECT_RATIO); CVisibilityPlugins::SetRenderWareCamera(Scene.camera); RwCameraClear(Scene.camera, &gColourTop, rwCAMERACLEARZ); -- cgit v1.2.3