[Scummvm-git-logs] scummvm master -> b786eec7745d884a9f588e29fa042931be9c46bd

aquadran noreply at scummvm.org
Thu Dec 30 12:05:04 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
b786eec774 WME3D: Remove "float" casting


Commit: b786eec7745d884a9f588e29fa042931be9c46bd
    https://github.com/scummvm/scummvm/commit/b786eec7745d884a9f588e29fa042931be9c46bd
Author: Paweł Kołodziejski (aquadran at gmail.com)
Date: 2021-12-30T13:04:58+01:00

Commit Message:
WME3D: Remove "float" casting

Changed paths:
    engines/wintermute/base/gfx/opengl/base_render_opengl3d.cpp
    engines/wintermute/base/gfx/opengl/base_render_opengl3d_shader.cpp


diff --git a/engines/wintermute/base/gfx/opengl/base_render_opengl3d.cpp b/engines/wintermute/base/gfx/opengl/base_render_opengl3d.cpp
index 86bfddb665d..38afbfeb608 100644
--- a/engines/wintermute/base/gfx/opengl/base_render_opengl3d.cpp
+++ b/engines/wintermute/base/gfx/opengl/base_render_opengl3d.cpp
@@ -280,7 +280,7 @@ void BaseRenderOpenGL3D::fadeToColor(byte r, byte g, byte b, byte a) {
 }
 
 bool BaseRenderOpenGL3D::fill(byte r, byte g, byte b, Common::Rect *rect) {
-	glClearColor(float(r) / 255.0f, float(g) / 255.0f, float(b) / 255.0f, 1.0f);
+	glClearColor(r / 255.0f, g / 255.0f, b / 255.0f, 1.0f);
 	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
 	return true;
 }
@@ -317,10 +317,10 @@ bool BaseRenderOpenGL3D::setProjection() {
 	float viewportHeight = _viewportRect.bottom - _viewportRect.top;
 
 	float verticalViewAngle = _fov;
-	float aspectRatio = float(viewportWidth) / float(viewportHeight);
+	float aspectRatio = viewportWidth / viewportHeight;
 	float top = _nearPlane * tanf(verticalViewAngle * 0.5f);
 
-	float scaleMod = static_cast<float>(_height) / static_cast<float>(viewportHeight);
+	float scaleMod = _height / viewportHeight;
 
 	glMatrixMode(GL_PROJECTION);
 	glLoadIdentity();
diff --git a/engines/wintermute/base/gfx/opengl/base_render_opengl3d_shader.cpp b/engines/wintermute/base/gfx/opengl/base_render_opengl3d_shader.cpp
index 866f007e87a..da430aab639 100644
--- a/engines/wintermute/base/gfx/opengl/base_render_opengl3d_shader.cpp
+++ b/engines/wintermute/base/gfx/opengl/base_render_opengl3d_shader.cpp
@@ -365,7 +365,7 @@ void BaseRenderOpenGL3DShader::fadeToColor(byte r, byte g, byte b, byte a) {
 }
 
 bool BaseRenderOpenGL3DShader::fill(byte r, byte g, byte b, Common::Rect *rect) {
-	glClearColor(float(r) / 255.0f, float(g) / 255.0f, float(b) / 255.0f, 1.0f);
+	glClearColor(r / 255.0f, g / 255.0f, b / 255.0f, 1.0f);
 	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
 	return true;
 }
@@ -420,9 +420,9 @@ bool BaseRenderOpenGL3DShader::setProjection() {
 	float viewportHeight = _viewportRect.bottom - _viewportRect.top;
 
 	float verticalViewAngle = _fov;
-	float aspectRatio = float(viewportWidth) / float(viewportHeight);
+	float aspectRatio = viewportWidth / viewportHeight;
 
-	float scaleMod = float(_height) / float(viewportHeight);
+	float scaleMod = _height / viewportHeight;
 
 	float top = _nearPlane * tanf(verticalViewAngle * 0.5f);
 




More information about the Scummvm-git-logs mailing list